source: osm/applications/editors/josm/plugins/smed/plugs/smed_about/build.xml@ 23499

Last change on this file since 23499 was 23499, checked in by postfix, 15 years ago

'images added'

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