source: osm/applications/editors/josm/plugins/multipoly-convert/build.xml@ 21012

Last change on this file since 21012 was 21012, checked in by sbrunner, 14 years ago

rm Plugin-Url

File size: 7.2 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3** This is the build file for the multipoly-convert 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="multipoly-convert" default="dist" basedir=".">
31
32
33 <!-- enter the SVN commit message -->
34 <property name="commit.message" value="Changed the constructor signature of the plugin main class" />
35 <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
36 <property name="plugin.main.version" value="2830" />
37
38
39 <!-- compilation properties -->
40 <property name="josm.build.dir" value="../../core" />
41 <property name="josm.home.dir" value="${user.home}/.josm" />
42 <property name="josm" location="../../core/dist/josm-custom.jar" />
43 <property name="plugin.build.dir" value="build" />
44 <property name="plugin.dist.dir" value="../../dist" />
45 <property name="plugin.name" value="${ant.project.name}" />
46 <property name="plugin.jar" value="${plugin.dist.dir}/${plugin.name}.jar" />
47
48 <!-- There's no josm.jar in the svn, so point "josm" to a local copy of your JOSM binary -->
49 <property name="josm" location="../../core/dist/josm-custom.jar" />
50
51 <property name="ant.build.javac.target" value="1.5" />
52
53 <target name="init">
54 <mkdir dir="${plugin.build.dir}">
55 </mkdir>
56 <mkdir dir="${plugin.dist.dir}">
57 </mkdir>
58 </target>
59
60 <target name="compile" depends="init">
61 <echo message="creating ${plugin.jar}" />
62 <javac srcdir="src" target="1.5" classpath="${josm}" destdir="build" debug="true">
63 <include name="**/*.java" />
64 </javac>
65 </target>
66
67 <target name="revision">
68 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
69 <env key="LANG" value="C" />
70 <arg value="info" />
71 <arg value="--xml" />
72 <arg value="." />
73 </exec>
74 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true" />
75 <delete file="REVISION" />
76 </target>
77
78 <target name="dist" depends="compile,revision">
79 <copy todir="${plugin.build.dir}/images">
80 <fileset dir="images" />
81 </copy>
82 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
83 <manifest>
84 <attribute name="Author" value="Stéphane Brunner" />
85 <attribute name="Plugin-Class" value="converttomultipoly.MultipolyPlugin" />
86 <attribute name="Plugin-Description" value="Simply convert an area to a multipolygon." />
87 <attribute name="Plugin-Version" value="${version.entry.commit.revision}" />
88 <attribute name="Plugin-Date" value="${version.entry.commit.date}" />
89 <attribute name="Plugin-Link" value="http://www.stephane-brunner.ch/mediawiki/index.php/Plugins" />
90 <attribute name="Plugin-Mainversion" value="${plugin.main.version}" />
91 <!--attribute name="2830_Plugin-Url" value="20583;http://trac.openstreetmap.org/browser/applications/editors/josm/dist/multipoly-convert.jar?rev=20584&amp;format=raw" /-->
92 </manifest>
93 </jar>
94 </target>
95
96 <target name="clean">
97 <delete dir="${plugin.build.dir}" />
98 <delete file="${plugin.jar}" />
99 </target>
100
101 <target name="clean_install">
102 <delete file="${plugins}/multipoly-convert.jar" />
103 </target>
104
105 <target name="install" depends="dist">
106 <property environment="env" />
107 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
108 <and>
109 <os family="windows" />
110 </and>
111 </condition>
112 <copy file="${plugin.jar}" todir="${josm.plugins.dir}" />
113 </target>
114
115 <!--
116 ************************** Publishing the plugin ***********************************
117 -->
118 <!--
119 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
120 ** property ${coreversion.info.entry.revision}
121 **
122 -->
123 <target name="core-info">
124 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
125 <env key="LANG" value="C" />
126 <arg value="info" />
127 <arg value="--xml" />
128 <arg value="../../core" />
129 </exec>
130 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true" />
131 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
132 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
133 <delete file="core.info.xml" />
134 </target>
135
136 <!--
137 ** commits the source tree for this plugin
138 -->
139 <target name="commit-current">
140 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
141 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
142 <env key="LANG" value="C" />
143 <arg value="commit" />
144 <arg value="-m '${commit.message}'" />
145 <arg value="." />
146 </exec>
147 </target>
148
149 <!--
150 ** updates (svn up) the source tree for this plugin
151 -->
152 <target name="update-current">
153 <echo>Updating plugin source ...</echo>
154 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
155 <env key="LANG" value="C" />
156 <arg value="up" />
157 <arg value="." />
158 </exec>
159 <echo>Updating ${plugin.jar} ...</echo>
160 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
161 <env key="LANG" value="C" />
162 <arg value="up" />
163 <arg value="../dist/${plugin.jar}" />
164 </exec>
165 </target>
166
167 <!--
168 ** commits the plugin.jar
169 -->
170 <target name="commit-dist">
171 <echo>
172 ***** Properties of published ${plugin.jar} *****
173 Commit message : '${commit.message}'
174 Plugin-Mainversion: ${plugin.main.version}
175 JOSM build version: ${coreversion.info.entry.revision}
176 Plugin-Version : ${version.entry.commit.revision}
177 ***** / Properties of published ${plugin.jar} *****
178
179 Now commiting ${plugin.jar} ...
180 </echo>
181 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
182 <env key="LANG" value="C" />
183 <arg value="-m '${commit.message}'" />
184 <arg value="commit" />
185 <arg value="${plugin.jar}" />
186 </exec>
187 </target>
188
189 <!-- ** make sure svn is present as a command line tool ** -->
190 <target name="ensure-svn-present">
191 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
192 <env key="LANG" value="C" />
193 <arg value="--version" />
194 </exec>
195 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
196 <!-- return code not set at all? Most likely svn isn't installed -->
197 <condition>
198 <not>
199 <isset property="svn.exit.code" />
200 </not>
201 </condition>
202 </fail>
203 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
204 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
205 <condition>
206 <isfailure code="${svn.exit.code}" />
207 </condition>
208 </fail>
209 </target>
210
211 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
212 </target>
213
214</project>
Note: See TracBrowser for help on using the repository browser.