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

Last change on this file since 19993 was 19422, checked in by guggis, 15 years ago

'Changed constructor for Plugin'

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="Changed constructor for Plugin" />
27 <property name="plugin.main.version" value="2830" />
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-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/AddrInterpolation"/>
98 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
99 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
100 </manifest>
101 </jar>
102 </target>
103
104 <!--
105 **********************************************************
106 ** revision - extracts the current revision number for the
107 ** file build.number and stores it in the XML property
108 ** version.*
109 **********************************************************
110 -->
111 <target name="revision">
112 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
113 <env key="LANG" value="C"/>
114 <arg value="info"/>
115 <arg value="--xml"/>
116 <arg value="."/>
117 </exec>
118 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
119 <delete file="REVISION"/>
120 </target>
121
122 <!--
123 **********************************************************
124 ** clean - clean up the build environment
125 **********************************************************
126 -->
127 <target name="clean">
128 <delete dir="${plugin.build.dir}"/>
129 <delete file="${plugin.jar}"/>
130 </target>
131
132 <!--
133 **********************************************************
134 ** install - install the plugin in your local JOSM installation
135 **********************************************************
136 -->
137 <target name="install" depends="dist">
138 <property environment="env"/>
139 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
140 <and>
141 <os family="windows"/>
142 </and>
143 </condition>
144 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
145 </target>
146
147 <!--
148 ************************** Publishing the plugin ***********************************
149 -->
150 <!--
151 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
152 ** property ${coreversion.info.entry.revision}
153 **
154 -->
155 <target name="core-info">
156 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
157 <env key="LANG" value="C"/>
158 <arg value="info"/>
159 <arg value="--xml"/>
160 <arg value="../../core"/>
161 </exec>
162 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
163 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
164 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
165 <delete file="core.info.xml" />
166 </target>
167
168 <!--
169 ** commits the source tree for this plugin
170 -->
171 <target name="commit-current">
172 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
173 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
174 <env key="LANG" value="C"/>
175 <arg value="commit"/>
176 <arg value="-m '${commit.message}'"/>
177 <arg value="."/>
178 </exec>
179 </target>
180
181 <!--
182 ** updates (svn up) the source tree for this plugin
183 -->
184 <target name="update-current">
185 <echo>Updating plugin source ...</echo>
186 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
187 <env key="LANG" value="C"/>
188 <arg value="up"/>
189 <arg value="."/>
190 </exec>
191 <echo>Updating ${plugin.jar} ...</echo>
192 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
193 <env key="LANG" value="C"/>
194 <arg value="up"/>
195 <arg value="../dist/${plugin.jar}"/>
196 </exec>
197 </target>
198
199 <!--
200 ** commits the plugin.jar
201 -->
202 <target name="commit-dist">
203 <echo>
204***** Properties of published ${plugin.jar} *****
205Commit message : '${commit.message}'
206Plugin-Mainversion: ${plugin.main.version}
207JOSM build version: ${coreversion.info.entry.revision}
208Plugin-Version : ${version.entry.commit.revision}
209***** / Properties of published ${plugin.jar} *****
210
211Now commiting ${plugin.jar} ...
212</echo>
213 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
214 <env key="LANG" value="C"/>
215 <arg value="-m '${commit.message}'"/>
216 <arg value="commit"/>
217 <arg value="${plugin.jar}"/>
218 </exec>
219 </target>
220
221 <!-- ** make sure svn is present as a command line tool ** -->
222 <target name="ensure-svn-present">
223 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
224 <env key="LANG" value="C" />
225 <arg value="--version" />
226 </exec>
227 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
228 <!-- return code not set at all? Most likely svn isn't installed -->
229 <condition>
230 <not>
231 <isset property="svn.exit.code" />
232 </not>
233 </condition>
234 </fail>
235 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
236 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
237 <condition>
238 <isfailure code="${svn.exit.code}" />
239 </condition>
240 </fail>
241 </target>
242
243 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
244 </target>
245</project>
Note: See TracBrowser for help on using the repository browser.