source: osm/applications/editors/josm/plugins/addrinterpolation/build.xml@ 25865

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

update all plugins

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