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

Last change on this file since 23187 was 23187, checked in by stoecker, 14 years ago

fix build

File size: 11.5 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="Commit message" />
34 <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
35 <property name="plugin.main.version" value="" />
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.ImageImportPlugin.ImageImportPlugin"/>
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-Mainversion" value="3376"/>
124 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
125 <attribute name="Class-Path" value="."/>
126 </manifest>
127 </jar>
128 </target>
129
130 <!--
131 **********************************************************
132 ** revision - extracts the current revision number for the
133 ** file build.number and stores it in the XML property
134 ** version.*
135 **********************************************************
136 -->
137 <target name="revision">
138
139 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
140 <env key="LANG" value="C"/>
141 <arg value="info"/>
142 <arg value="--xml"/>
143 <arg value="."/>
144 </exec>
145 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
146 <delete file="REVISION"/>
147 </target>
148
149 <!--
150 **********************************************************
151 ** clean - clean up the build environment
152 **********************************************************
153 -->
154 <target name="clean">
155 <delete dir="${plugin.build.dir}"/>
156 <delete file="${plugin.jar}"/>
157 </target>
158
159 <!--
160 **********************************************************
161 ** install - install the plugin in your local JOSM installation
162 **********************************************************
163 -->
164 <target name="install" depends="dist">
165 <property environment="env"/>
166 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
167 <and>
168 <os family="windows"/>
169 </and>
170 </condition>
171 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
172 </target>
173
174
175 <!--
176 ************************** Publishing the plugin ***********************************
177 -->
178 <!--
179 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
180 ** property ${coreversion.info.entry.revision}
181 **
182 -->
183 <target name="core-info">
184 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
185 <env key="LANG" value="C"/>
186 <arg value="info"/>
187 <arg value="--xml"/>
188 <arg value="../../core"/>
189 </exec>
190 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
191 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
192 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
193 <delete file="core.info.xml" />
194 </target>
195
196 <!--
197 ** commits the source tree for this plugin
198 -->
199 <target name="commit-current">
200 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
201 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
202 <env key="LANG" value="C"/>
203 <arg value="commit"/>
204 <arg value="-m '${commit.message}'"/>
205 <arg value="."/>
206 </exec>
207 </target>
208
209 <!--
210 ** updates (svn up) the source tree for this plugin
211 -->
212 <target name="update-current">
213 <echo>Updating plugin source ...</echo>
214 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
215 <env key="LANG" value="C"/>
216 <arg value="up"/>
217 <arg value="."/>
218 </exec>
219 <echo>Updating ${plugin.jar} ...</echo>
220 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
221 <env key="LANG" value="C"/>
222 <arg value="up"/>
223 <arg value="../dist/${plugin.jar}"/>
224 </exec>
225 </target>
226
227 <!--
228 ** commits the plugin.jar
229 -->
230 <target name="commit-dist">
231 <echo>
232 ***** Properties of published ${plugin.jar} *****
233 Commit message : '${commit.message}'
234 Plugin-Mainversion: ${plugin.main.version}
235 JOSM build version: ${coreversion.info.entry.revision}
236 Plugin-Version : ${version.entry.commit.revision}
237 ***** / Properties of published ${plugin.jar} *****
238
239 Now commiting ${plugin.jar} ...
240 </echo>
241 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
242 <env key="LANG" value="C"/>
243 <arg value="-m '${commit.message}'"/>
244 <arg value="commit"/>
245 <arg value="${plugin.jar}"/>
246 </exec>
247 </target>
248
249 <!-- ** make sure svn is present as a command line tool ** -->
250 <target name="ensure-svn-present">
251 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
252 <env key="LANG" value="C" />
253 <arg value="--version" />
254 </exec>
255 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
256 <!-- return code not set at all? Most likely svn isn't installed -->
257 <condition>
258 <not>
259 <isset property="svn.exit.code" />
260 </not>
261 </condition>
262 </fail>
263 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
264 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
265 <condition>
266 <isfailure code="${svn.exit.code}" />
267 </condition>
268 </fail>
269 </target>
270
271 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
272 </target>
273
274 <target name="unjar-test" >
275 <!--unjar dest="C:/Workspace_2/geotoolstest/lib/unjartest">
276 <fileset dir="lib"/>
277 </unjar-->
278
279 <jar destfile="C:/Workspace_2/geotoolstest/lib/unjartest/${ant.project.name}.jar" basedir="C:/Workspace_2/geotoolstest/lib/unjartest">
280
281 <manifest>
282 <attribute name="Author" value="Christoph Beekmans, Fabian Kowitz, Anna Robaszkiewicz, Oliver Kuhn, Martin Ulitzny"/>
283 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.CoveragePlugin.CoveragePlugin"/>
284 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
285 <attribute name="Plugin-Description" value="Plugin for importing spatial referenced images"/>
286 <attribute name="Plugin-Link" value="..."/>
287 <attribute name="Plugin-Mainversion" value=".."/>
288 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
289 <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" />
290 </manifest>
291 </jar>
292 </target>
293
294</project>
Note: See TracBrowser for help on using the repository browser.