source: osm/applications/editors/josm/plugins/restart/build.xml@ 28438

Last change on this file since 28438 was 28438, checked in by upliner, 12 years ago

'fix #j5635 -- pass java start options when restarting'

  • Property svn:eol-style set to native
File size: 9.5 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="restart" default="dist" basedir=".">
31 <!-- enter the SVN commit message -->
32 <property name="commit.message" value="fix #j5635 -- pass java start options when restarting"/>
33 <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
34 <property name="plugin.main.version" value="4980"/>
35 <!--
36 ************************************************
37 ** should not be necessary to change the following properties
38 -->
39 <property name="josm" location="../../core/dist/josm-custom.jar"/>
40 <property name="plugin.build.dir" value="build"/>
41 <property name="plugin.src.dir" value="src"/>
42 <!-- this is the directory where the plugin jar is copied to -->
43 <property name="plugin.dist.dir" value="../../dist"/>
44 <property name="ant.build.javac.target" value="1.5"/>
45 <property name="plugin.dist.dir" value="../../dist"/>
46 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
47 <!--
48 **********************************************************
49 ** init - initializes the build
50 **********************************************************
51 -->
52 <target name="init">
53 <mkdir dir="${plugin.build.dir}"/>
54 </target>
55 <!--
56 **********************************************************
57 ** compile - complies the source tree
58 **********************************************************
59 -->
60 <target name="compile" depends="init">
61 <echo message="compiling sources for ${plugin.jar} ... "/>
62 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
63 <compilerarg value="-Xlint:deprecation"/>
64 <compilerarg value="-Xlint:unchecked"/>
65 </javac>
66 </target>
67 <!--
68 **********************************************************
69 ** dist - creates the plugin jar
70 **********************************************************
71 -->
72 <target name="dist" depends="compile,revision">
73 <echo message="creating ${ant.project.name}.jar ... "/>
74 <copy todir="${plugin.build.dir}">
75 <fileset dir=".">
76 <include name="README"/>
77 <include name="LICENSE"/>
78 </fileset>
79 </copy>
80 <copy todir="${plugin.build.dir}/data">
81 <fileset dir="data"/>
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="Upliner"/>
94 <attribute name="Plugin-Class" value="josmrestartplugin.RestartPlugin"/>
95 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
96 <attribute name="Plugin-Description" value="Adds &quot;Restart JOSM&quot; item to File menu."/>
97 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
98 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
99 </manifest>
100 </jar>
101 </target>
102 <!--
103 **********************************************************
104 ** revision - extracts the current revision number for the
105 ** file build.number and stores it in the XML property
106 ** version.*
107 **********************************************************
108 -->
109 <target name="revision">
110 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
111 <env key="LANG" value="C"/>
112 <arg value="info"/>
113 <arg value="--xml"/>
114 <arg value="."/>
115 </exec>
116 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
117 <delete file="REVISION"/>
118 </target>
119 <!--
120 **********************************************************
121 ** clean - clean up the build environment
122 **********************************************************
123 -->
124 <target name="clean">
125 <delete dir="${plugin.build.dir}"/>
126 <delete file="${plugin.jar}"/>
127 </target>
128 <!--
129 **********************************************************
130 ** install - install the plugin in your local JOSM installation
131 **********************************************************
132 -->
133 <target name="install" depends="dist">
134 <property environment="env"/>
135 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
136 <and>
137 <os family="windows"/>
138 </and>
139 </condition>
140 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
141 </target>
142 <!--
143 ************************** Publishing the plugin ***********************************
144 -->
145 <!--
146 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
147 ** property ${coreversion.info.entry.revision}
148 **
149 -->
150 <target name="core-info">
151 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
152 <env key="LANG" value="C"/>
153 <arg value="info"/>
154 <arg value="--xml"/>
155 <arg value="../../core"/>
156 </exec>
157 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
158 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
159 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
160 <delete file="core.info.xml"/>
161 </target>
162 <!--
163 ** commits the source tree for this plugin
164 -->
165 <target name="commit-current">
166 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
167 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
168 <env key="LANG" value="C"/>
169 <arg value="commit"/>
170 <arg value="-m '${commit.message}'"/>
171 <arg value="."/>
172 </exec>
173 </target>
174 <!--
175 ** updates (svn up) the source tree for this plugin
176 -->
177 <target name="update-current">
178 <echo>Updating plugin source ...</echo>
179 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
180 <env key="LANG" value="C"/>
181 <arg value="up"/>
182 <arg value="."/>
183 </exec>
184 <echo>Updating ${plugin.jar} ...</echo>
185 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
186 <env key="LANG" value="C"/>
187 <arg value="up"/>
188 <arg value="../dist/${plugin.jar}"/>
189 </exec>
190 </target>
191 <!--
192 ** commits the plugin.jar
193 -->
194 <target name="commit-dist">
195 <echo>
196 ***** Properties of published ${plugin.jar} *****
197 Commit message : '${commit.message}'
198 Plugin-Mainversion: ${plugin.main.version}
199 JOSM build version: ${coreversion.info.entry.revision}
200 Plugin-Version : ${version.entry.commit.revision}
201 ***** / Properties of published ${plugin.jar} *****
202
203 Now commiting ${plugin.jar} ...
204 </echo>
205 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
206 <env key="LANG" value="C"/>
207 <arg value="-m '${commit.message}'"/>
208 <arg value="commit"/>
209 <arg value="${plugin.jar}"/>
210 </exec>
211 </target>
212 <!-- ** make sure svn is present as a command line tool ** -->
213 <target name="ensure-svn-present">
214 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
215 <env key="LANG" value="C"/>
216 <arg value="--version"/>
217 </exec>
218 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
219 <!-- return code not set at all? Most likely svn isn't installed -->
220 <condition>
221 <not>
222 <isset property="svn.exit.code"/>
223 </not>
224 </condition>
225 </fail>
226 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
227 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
228 <condition>
229 <isfailure code="${svn.exit.code}"/>
230 </condition>
231 </fail>
232 </target>
233 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
234 </target>
235</project>
Note: See TracBrowser for help on using the repository browser.