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

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

i18n update, split plugin and core translation

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