source: osm/applications/editors/josm/plugins/ImportImagePlugin/build.xml@ 27587

Last change on this file since 27587 was 27354, checked in by stoecker, 13 years ago

some more icon updates

File size: 11.7 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3** This is a template build file for a JOSM plugin.
4**
5** Maintaining versions
6** ====================
7** see README.template
8**
9** Usage
10** =====
11** To build it run
12**
13** > ant dist
14**
15** To install the generated plugin locally (in you default plugin directory) run
16**
17** > ant install
18**
19** The generated plugin jar is not automatically available in JOSMs plugin configuration
20** dialog. You have to check it in first.
21**
22** Use the ant target 'publish' to check in the plugin and make it available to other
23** JOSM users:
24** set the properties commit.message and plugin.main.version
25** and run
26** > ant publish
27**
28**
29-->
30<project name="ImportImagePlugin" default="dist" basedir=".">
31
32 <!-- enter the SVN commit message -->
33 <property name="commit.message" value="use consistent plugin name (don't mix up the words)" />
34 <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
35 <property name="plugin.main.version" value="4549" />
36
37
38 <!--
39 ************************************************
40 ** should not be necessary to change the following properties
41 -->
42 <property name="josm" location="../../core/dist/josm-custom.jar"/>
43 <property name="plugin.build.dir" value="build"/>
44 <property name="plugin.src.dir" value="src"/>
45 <!-- this is the directory where the plugin jar is copied to -->
46 <property name="plugin.dist.dir" value="../../dist"/>
47 <property name="ant.build.javac.target" value="1.5"/>
48 <property name="plugin.dist.dir" value="../../dist"/>
49 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
50
51 <!--
52 **********************************************************
53 ** init - initializes the build
54 **********************************************************
55 -->
56 <target name="init">
57 <mkdir dir="${plugin.build.dir}"/>
58 </target>
59
60 <!--
61 **********************************************************
62 ** compile - complies the source tree
63 **********************************************************
64 -->
65 <target name="compile" depends="init">
66 <echo message="compiling sources for ${plugin.jar} ... "/>
67 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
68 <classpath>
69 <pathelement location="${josm}"/>
70 <fileset dir="lib">
71 <include name="**/*.jar"/>
72 </fileset>
73 </classpath>
74 <compilerarg value="-Xlint:deprecation"/>
75 <compilerarg value="-Xlint:unchecked"/>
76 </javac>
77 </target>
78
79 <!--
80 **********************************************************
81 ** dist - creates the plugin jar
82 **********************************************************
83 -->
84 <target name="dist" depends="compile,revision">
85 <echo message="creating ${ant.project.name}.jar ... "/>
86
87 <copy todir="${plugin.build.dir}/lib">
88 <fileset dir="lib">
89 <not>
90 <filename name="log4j-1.2.12.jar"/>
91 </not>
92 </fileset>
93 </copy>
94 <unjar src="lib/log4j-1.2.12.jar" dest="${plugin.build.dir}"/>
95 <copy todir="${plugin.build.dir}/images">
96 <fileset dir="images"/>
97 </copy>
98 <copy todir="${plugin.build.dir}/resources">
99 <fileset dir="resources"/>
100 </copy>
101 <copy todir="${plugin.build.dir}">
102 <fileset dir=".">
103 <include name="README" />
104 <include name="LICENSE" />
105 </fileset>
106 </copy>
107
108 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
109 <!--
110 ************************************************
111 ** configure these properties. Most of them will be copied to the plugins
112 ** manifest file. Property values will also show up in the list available
113 ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
114 **
115 ************************************************
116 -->
117
118 <manifest>
119 <attribute name="Author" value="Christoph Beekmans, Fabian Kowitz, Anna Robaszkiewicz, Oliver Kuhn, Martin Ulitzny"/>
120 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.ImportImagePlugin.ImportImagePlugin"/>
121 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
122 <attribute name="Plugin-Description" value="Plugin for importing spatial referenced images"/>
123 <attribute name="Plugin-Icon" value="images/layericon.png"/>
124 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/ImportImagePlugin"/>
125 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
126 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
127 </manifest>
128 </jar>
129 </target>
130
131 <!--
132 **********************************************************
133 ** revision - extracts the current revision number for the
134 ** file build.number and stores it in the XML property
135 ** version.*
136 **********************************************************
137 -->
138 <target name="revision">
139
140 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
141 <env key="LANG" value="C"/>
142 <arg value="info"/>
143 <arg value="--xml"/>
144 <arg value="."/>
145 </exec>
146 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
147 <delete file="REVISION"/>
148 </target>
149
150 <!--
151 **********************************************************
152 ** clean - clean up the build environment
153 **********************************************************
154 -->
155 <target name="clean">
156 <delete dir="${plugin.build.dir}"/>
157 <delete file="${plugin.jar}"/>
158 </target>
159
160 <!--
161 **********************************************************
162 ** install - install the plugin in your local JOSM installation
163 **********************************************************
164 -->
165 <target name="install" depends="dist">
166 <property environment="env"/>
167 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
168 <and>
169 <os family="windows"/>
170 </and>
171 </condition>
172 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
173 </target>
174
175
176 <!--
177 ************************** Publishing the plugin ***********************************
178 -->
179 <!--
180 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
181 ** property ${coreversion.info.entry.revision}
182 **
183 -->
184 <target name="core-info">
185 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
186 <env key="LANG" value="C"/>
187 <arg value="info"/>
188 <arg value="--xml"/>
189 <arg value="../../core"/>
190 </exec>
191 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
192 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
193 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
194 <delete file="core.info.xml" />
195 </target>
196
197 <!--
198 ** commits the source tree for this plugin
199 -->
200 <target name="commit-current">
201 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
202 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
203 <env key="LANG" value="C"/>
204 <arg value="commit"/>
205 <arg value="-m '${commit.message}'"/>
206 <arg value="."/>
207 </exec>
208 </target>
209
210 <!--
211 ** updates (svn up) the source tree for this plugin
212 -->
213 <target name="update-current">
214 <echo>Updating plugin source ...</echo>
215 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
216 <env key="LANG" value="C"/>
217 <arg value="up"/>
218 <arg value="."/>
219 </exec>
220 <echo>Updating ${plugin.jar} ...</echo>
221 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
222 <env key="LANG" value="C"/>
223 <arg value="up"/>
224 <arg value="../dist/${plugin.jar}"/>
225 </exec>
226 </target>
227
228 <!--
229 ** commits the plugin.jar
230 -->
231 <target name="commit-dist">
232 <echo>
233 ***** Properties of published ${plugin.jar} *****
234 Commit message : '${commit.message}'
235 Plugin-Mainversion: ${plugin.main.version}
236 JOSM build version: ${coreversion.info.entry.revision}
237 Plugin-Version : ${version.entry.commit.revision}
238 ***** / Properties of published ${plugin.jar} *****
239
240 Now commiting ${plugin.jar} ...
241 </echo>
242 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
243 <env key="LANG" value="C"/>
244 <arg value="-m '${commit.message}'"/>
245 <arg value="commit"/>
246 <arg value="${plugin.jar}"/>
247 </exec>
248 </target>
249
250 <!-- ** make sure svn is present as a command line tool ** -->
251 <target name="ensure-svn-present">
252 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
253 <env key="LANG" value="C" />
254 <arg value="--version" />
255 </exec>
256 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
257 <!-- return code not set at all? Most likely svn isn't installed -->
258 <condition>
259 <not>
260 <isset property="svn.exit.code" />
261 </not>
262 </condition>
263 </fail>
264 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
265 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
266 <condition>
267 <isfailure code="${svn.exit.code}" />
268 </condition>
269 </fail>
270 </target>
271
272 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
273 </target>
274
275 <target name="unjar-test" >
276 <!--unjar dest="C:/Workspace_2/geotoolstest/lib/unjartest">
277 <fileset dir="lib"/>
278 </unjar-->
279
280 <jar destfile="C:/Workspace_2/geotoolstest/lib/unjartest/${ant.project.name}.jar" basedir="C:/Workspace_2/geotoolstest/lib/unjartest">
281
282 <manifest>
283 <attribute name="Author" value="Christoph Beekmans, Fabian Kowitz, Anna Robaszkiewicz, Oliver Kuhn, Martin Ulitzny"/>
284 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.CoveragePlugin.CoveragePlugin"/>
285 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
286 <attribute name="Plugin-Description" value="Plugin for importing spatial referenced images"/>
287 <attribute name="Plugin-Link" value="..."/>
288 <attribute name="Plugin-Mainversion" value=".."/>
289 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
290 <attribute name="Class-path" value=" . CoveragePlugin/lib/commons-beanutils-1.7.0.jar CoveragePlugin/lib/commons-pool-1.5.3.jar CoveragePlugin/lib/geoapi-2.3-M1.jar CoveragePlugin/lib/geoapi-pending-2.3-M1.jar CoveragePlugin/lib/geoapi.jar CoveragePlugin/lib/gt-api-2.6.0.jar CoveragePlugin/lib/gt-coverage-2.6.0.jar CoveragePlugin/lib/gt-epsg-extension-2.6.0.jar CoveragePlugin/lib/gt-epsg-hsql-2.6.0.jar CoveragePlugin/lib/gt-geotiff-2.6.0.jar CoveragePlugin/lib/gt-main-2.6.0.jar CoveragePlugin/lib/gt-metadata-2.6.0.jar CoveragePlugin/lib/gt-referencing-2.6.0.jar CoveragePlugin/lib/hsqldb-1.8.0.7.jar CoveragePlugin/lib/imageio-ext-tiff-1.0.4.jar CoveragePlugin/lib/imageio-ext-utilities-1.0.4.jar CoveragePlugin/lib/jai_codec-1.1.3.jar CoveragePlugin/lib/jai_core.jar CoveragePlugin/lib/jai_imageio-1.1.jar CoveragePlugin/lib/jdom-1.0.jar CoveragePlugin/lib/jsr-275-1.0-beta-2.jar CoveragePlugin/lib/jts-1.10.jar CoveragePlugin/lib/log4j-1.2.12.jar CoveragePlugin/lib/vecmath-1.3.2.jar" />
291 </manifest>
292 </jar>
293 </target>
294
295</project>
Note: See TracBrowser for help on using the repository browser.