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

Last change on this file since 26406 was 26174, checked in by stoecker, 13 years ago

i18n update, split plugin and core translation

File size: 12.4 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 <!-- enter the SVN commit message -->
32 <property name="commit.message" value="use consistent plugin name (don't mix up the words)"/>
33 <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
34 <property name="plugin.main.version" value="4065"/>
35 <!--
36 ************************************************
37 ** should not be necessary to change the following properties
38 -->
39 <property name="josm" location="../../core/dist/josm-custom.jar"/>
40 <property name="plugin.build.dir" value="build"/>
41 <property name="plugin.src.dir" value="src"/>
42 <!-- this is the directory where the plugin jar is copied to -->
43 <property name="plugin.dist.dir" value="../../dist"/>
44 <property name="ant.build.javac.target" value="1.5"/>
45 <property name="plugin.dist.dir" value="../../dist"/>
46 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
47 <!--
48 **********************************************************
49 ** init - initializes the build
50 **********************************************************
51 -->
52 <target name="init">
53 <mkdir dir="${plugin.build.dir}"/>
54 </target>
55 <!--
56 **********************************************************
57 ** compile - complies the source tree
58 **********************************************************
59 -->
60 <target name="compile" depends="init">
61 <echo message="compiling sources for ${plugin.jar} ... "/>
62 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
63 <classpath>
64 <pathelement location="${josm}"/>
65 <fileset dir="lib">
66 <include name="**/*.jar"/>
67 </fileset>
68 </classpath>
69 <compilerarg value="-Xlint:deprecation"/>
70 <compilerarg value="-Xlint:unchecked"/>
71 </javac>
72 </target>
73 <!--
74 **********************************************************
75 ** dist - creates the plugin jar
76 **********************************************************
77 -->
78 <target name="dist" depends="compile,revision">
79 <echo message="creating ${ant.project.name}.jar ... "/>
80 <copy todir="${plugin.build.dir}/lib">
81 <fileset dir="lib">
82 <not>
83 <filename name="log4j-1.2.12.jar"/>
84 </not>
85 </fileset>
86 </copy>
87 <unjar src="lib/log4j-1.2.12.jar" dest="${plugin.build.dir}"/>
88 <copy todir="${plugin.build.dir}/images">
89 <fileset dir="images"/>
90 </copy>
91 <copy todir="${plugin.build.dir}/data">
92 <fileset dir="data"/>
93 </copy>
94 <copy todir="${plugin.build.dir}/resources">
95 <fileset dir="resources"/>
96 </copy>
97 <copy todir="${plugin.build.dir}">
98 <fileset dir=".">
99 <include name="README"/>
100 <include name="LICENSE"/>
101 </fileset>
102 </copy>
103 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
104 <!--
105 ************************************************
106 ** configure these properties. Most of them will be copied to the plugins
107 ** manifest file. Property values will also show up in the list available
108 ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
109 **
110 ************************************************
111 -->
112 <manifest>
113 <attribute name="Author" value="Christoph Beekmans, Fabian Kowitz, Anna Robaszkiewicz, Oliver Kuhn, Martin Ulitzny"/>
114 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.ImportImagePlugin.ImportImagePlugin"/>
115 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
116 <attribute name="Plugin-Description" value="Plugin for importing spatial referenced images"/>
117 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/ImportImagePlugin"/>
118 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
119 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
120 </manifest>
121 </jar>
122 </target>
123 <!--
124 **********************************************************
125 ** revision - extracts the current revision number for the
126 ** file build.number and stores it in the XML property
127 ** version.*
128 **********************************************************
129 -->
130 <target name="revision">
131 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
132 <env key="LANG" value="C"/>
133 <arg value="info"/>
134 <arg value="--xml"/>
135 <arg value="."/>
136 </exec>
137 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
138 <delete file="REVISION"/>
139 </target>
140 <!--
141 **********************************************************
142 ** clean - clean up the build environment
143 **********************************************************
144 -->
145 <target name="clean">
146 <delete dir="${plugin.build.dir}"/>
147 <delete file="${plugin.jar}"/>
148 </target>
149 <!--
150 **********************************************************
151 ** install - install the plugin in your local JOSM installation
152 **********************************************************
153 -->
154 <target name="install" depends="dist">
155 <property environment="env"/>
156 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
157 <and>
158 <os family="windows"/>
159 </and>
160 </condition>
161 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
162 </target>
163 <!--
164 ************************** Publishing the plugin ***********************************
165 -->
166 <!--
167 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
168 ** property ${coreversion.info.entry.revision}
169 **
170 -->
171 <target name="core-info">
172 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
173 <env key="LANG" value="C"/>
174 <arg value="info"/>
175 <arg value="--xml"/>
176 <arg value="../../core"/>
177 </exec>
178 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
179 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
180 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
181 <delete file="core.info.xml"/>
182 </target>
183 <!--
184 ** commits the source tree for this plugin
185 -->
186 <target name="commit-current">
187 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
188 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
189 <env key="LANG" value="C"/>
190 <arg value="commit"/>
191 <arg value="-m '${commit.message}'"/>
192 <arg value="."/>
193 </exec>
194 </target>
195 <!--
196 ** updates (svn up) the source tree for this plugin
197 -->
198 <target name="update-current">
199 <echo>Updating plugin source ...</echo>
200 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
201 <env key="LANG" value="C"/>
202 <arg value="up"/>
203 <arg value="."/>
204 </exec>
205 <echo>Updating ${plugin.jar} ...</echo>
206 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
207 <env key="LANG" value="C"/>
208 <arg value="up"/>
209 <arg value="../dist/${plugin.jar}"/>
210 </exec>
211 </target>
212 <!--
213 ** commits the plugin.jar
214 -->
215 <target name="commit-dist">
216 <echo>
217 ***** Properties of published ${plugin.jar} *****
218 Commit message : '${commit.message}'
219 Plugin-Mainversion: ${plugin.main.version}
220 JOSM build version: ${coreversion.info.entry.revision}
221 Plugin-Version : ${version.entry.commit.revision}
222 ***** / Properties of published ${plugin.jar} *****
223
224 Now commiting ${plugin.jar} ...
225 </echo>
226 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
227 <env key="LANG" value="C"/>
228 <arg value="-m '${commit.message}'"/>
229 <arg value="commit"/>
230 <arg value="${plugin.jar}"/>
231 </exec>
232 </target>
233 <!-- ** make sure svn is present as a command line tool ** -->
234 <target name="ensure-svn-present">
235 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
236 <env key="LANG" value="C"/>
237 <arg value="--version"/>
238 </exec>
239 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
240 <!-- return code not set at all? Most likely svn isn't installed -->
241 <condition>
242 <not>
243 <isset property="svn.exit.code"/>
244 </not>
245 </condition>
246 </fail>
247 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
248 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
249 <condition>
250 <isfailure code="${svn.exit.code}"/>
251 </condition>
252 </fail>
253 </target>
254 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
255 </target>
256 <target name="unjar-test">
257 <!--unjar dest="C:/Workspace_2/geotoolstest/lib/unjartest">
258 <fileset dir="lib"/>
259 </unjar-->
260 <jar destfile="C:/Workspace_2/geotoolstest/lib/unjartest/${ant.project.name}.jar" basedir="C:/Workspace_2/geotoolstest/lib/unjartest">
261 <manifest>
262 <attribute name="Author" value="Christoph Beekmans, Fabian Kowitz, Anna Robaszkiewicz, Oliver Kuhn, Martin Ulitzny"/>
263 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.CoveragePlugin.CoveragePlugin"/>
264 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
265 <attribute name="Plugin-Description" value="Plugin for importing spatial referenced images"/>
266 <attribute name="Plugin-Link" value="..."/>
267 <attribute name="Plugin-Mainversion" value=".."/>
268 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
269 <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"/>
270 </manifest>
271 </jar>
272 </target>
273</project>
Note: See TracBrowser for help on using the repository browser.