1 | <!--
|
---|
2 | ** This is a template build file for a JOSM plugin.
|
---|
3 | **
|
---|
4 | ** Maintaining versions
|
---|
5 | ** ====================
|
---|
6 | ** see README.template
|
---|
7 | **
|
---|
8 | ** Usage
|
---|
9 | ** =====
|
---|
10 | ** To build it run
|
---|
11 | **
|
---|
12 | ** > ant dist
|
---|
13 | **
|
---|
14 | ** To install the generated plugin locally (in your default plugin directory) run
|
---|
15 | **
|
---|
16 | ** > ant install
|
---|
17 | **
|
---|
18 | ** To build against the core in ../../core, create a correct manifest and deploy to
|
---|
19 | ** SVN, run
|
---|
20 | ** - set the property commit.message
|
---|
21 | ** - set the property josm.reference.release to lowest JOSM release number this
|
---|
22 | ** plugin build is compatible with
|
---|
23 | ** > ant deploy
|
---|
24 | **
|
---|
25 | **
|
---|
26 | -->
|
---|
27 | <project name="wmsplugin" default="dist" basedir=".">
|
---|
28 | <property name="josm" location="../../core/dist/josm-custom.jar"/>
|
---|
29 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
30 | <property name="plugin.build.dir" value="build"/>
|
---|
31 | <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
|
---|
32 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
33 | <property name="commit.message" value="fixing JOSM issue #3186" />
|
---|
34 | <property name="josm.reference.release" value="2020" />
|
---|
35 |
|
---|
36 | <target name="init">
|
---|
37 | <mkdir dir="${plugin.build.dir}"/>
|
---|
38 | </target>
|
---|
39 | <target name="compile" depends="init">
|
---|
40 | <echo message="creating ${plugin.jar}"/>
|
---|
41 | <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
|
---|
42 | <compilerarg value="-Xlint:deprecation"/>
|
---|
43 | <compilerarg value="-Xlint:unchecked"/>
|
---|
44 | </javac>
|
---|
45 | </target>
|
---|
46 | <target name="dist" depends="compile,revision">
|
---|
47 | <echo message="building ${plugin.jar} with version ${version.entry.commit.revision} for JOSM version ${josm.reference.release} "/>
|
---|
48 | <copy todir="${plugin.build.dir}/images">
|
---|
49 | <fileset dir="images"/>
|
---|
50 | </copy>
|
---|
51 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
---|
52 | <manifest>
|
---|
53 | <attribute name="Author" value="Tim Waters, Petr Dlouhý"/>
|
---|
54 | <attribute name="Plugin-Class" value="wmsplugin.WMSPlugin"/>
|
---|
55 | <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
|
---|
56 | <attribute name="Plugin-Description" value="Display georeferenced images as background in JOSM (WMS servers, Yahoo, ...)."/>
|
---|
57 | <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/WMSPlugin"/>
|
---|
58 | <attribute name="Plugin-Mainversion" value="${josm.reference.release}"/>
|
---|
59 | <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
|
---|
60 | <attribute name="de_Plugin-Link" value="http://wiki.openstreetmap.org/wiki/DE:JOSM/Plugins/WMSPlugin"/>
|
---|
61 | </manifest>
|
---|
62 | </jar>
|
---|
63 | </target>
|
---|
64 | <target name="revision">
|
---|
65 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
---|
66 | <env key="LANG" value="C"/>
|
---|
67 | <arg value="info"/>
|
---|
68 | <arg value="--xml"/>
|
---|
69 | <arg value="."/>
|
---|
70 | </exec>
|
---|
71 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
72 | <delete file="REVISION"/>
|
---|
73 | </target>
|
---|
74 | <target name="clean">
|
---|
75 | <delete dir="${plugin.build.dir}"/>
|
---|
76 | <delete file="${plugin.jar}"/>
|
---|
77 | </target>
|
---|
78 | <target name="install" depends="dist">
|
---|
79 | <property environment="env"/>
|
---|
80 | <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
|
---|
81 | <and>
|
---|
82 | <os family="windows"/>
|
---|
83 | </and>
|
---|
84 | </condition>
|
---|
85 | <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
|
---|
86 | </target>
|
---|
87 |
|
---|
88 | <target name="core-info">
|
---|
89 | <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
|
---|
90 | <env key="LANG" value="C"/>
|
---|
91 | <arg value="info"/>
|
---|
92 | <arg value="--xml"/>
|
---|
93 | <arg value="../../core"/>
|
---|
94 | </exec>
|
---|
95 | <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
|
---|
96 | <echo>Building against core revision ${coreversion.info.entry.revision} ...</echo>
|
---|
97 | <delete file="core.info.xml" />
|
---|
98 | </target>
|
---|
99 |
|
---|
100 |
|
---|
101 | <target name="commit-current">
|
---|
102 | <echo>Commiting the plugin source ...</echo>
|
---|
103 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
104 | <env key="LANG" value="C"/>
|
---|
105 | <arg value="commit"/>
|
---|
106 | <arg value="-m "${commit.message}""/>
|
---|
107 | <arg value="."/>
|
---|
108 | </exec>
|
---|
109 | </target>
|
---|
110 |
|
---|
111 |
|
---|
112 | <target name="update-current">
|
---|
113 | <echo>Updating basedir ...</echo>
|
---|
114 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
115 | <env key="LANG" value="C"/>
|
---|
116 | <arg value="up"/>
|
---|
117 | <arg value="."/>
|
---|
118 | </exec>
|
---|
119 | <echo>Updating ${plugin.jar} ...</echo>
|
---|
120 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
121 | <env key="LANG" value="C"/>
|
---|
122 | <arg value="up"/>
|
---|
123 | <arg value="${plugin.jar}"/>
|
---|
124 | </exec>
|
---|
125 | </target>
|
---|
126 |
|
---|
127 | <target name="commit-dist">
|
---|
128 | <echo>Commiting ${plugin.jar} ...</echo>
|
---|
129 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
130 | <env key="LANG" value="C"/>
|
---|
131 | <arg value="commit"/>
|
---|
132 | <arg value="-m "${commit.message}""/>
|
---|
133 | <arg value="${plugin.jar}"/>
|
---|
134 | </exec>
|
---|
135 | </target>
|
---|
136 |
|
---|
137 | <target name="deploy" depends="core-info,commit-current,update-current,clean,dist,commit-dist">
|
---|
138 | </target>
|
---|
139 | </project>
|
---|