source: osm/applications/editors/josm/plugins/editgpx/build.xml@ 23864

Last change on this file since 23864 was 23659, checked in by mgarbe, 14 years ago

'Changed constructor signature of plugin main class'

File size: 6.6 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3** This is the build file for the editgpx 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 your default plugin directory) run
16**
17** > ant install
18**
19** To build against the core in ../../core, create a correct manifest and deploy to
20** SVN,
21** set the properties commit.message and plugin.main.version
22** and run
23** > ant publish
24**
25**
26-->
27<project name="editgpx" default="dist" basedir=".">
28
29
30 <property name="commit.message" value="Changed constructor signature of plugin main class" />
31 <property name="plugin.main.version" value="3408" />
32
33
34 <!-- <property name="josm" location="../../core/dist/josm-custom.jar"/> -->
35 <property name="josm" location="../JOSM/dist/josm-custom.jar"/>
36 <!-- <property name="plugin.dist.dir" value="../../dist"/>-->
37 <property name="plugin.dist.dir" value=".."/>
38 <property name="plugin.build.dir" value="build"/>
39 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
40 <property name="ant.build.javac.target" value="1.5"/>
41 <target name="init">
42 <mkdir dir="${plugin.build.dir}"/>
43 </target>
44 <target name="compile" depends="init">
45 <echo message="creating ${plugin.jar}"/>
46 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
47 <compilerarg value="-Xlint:deprecation"/>
48 <compilerarg value="-Xlint:unchecked"/>
49 </javac>
50 </target>
51 <target name="dist" depends="compile,revision">
52 <copy todir="${plugin.build.dir}/images">
53 <fileset dir="images"/>
54 </copy>
55 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
56 <manifest>
57 <attribute name="Author" value="Martin Garbe" />
58 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.editgpx.EditGpxPlugin" />
59 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
60 <attribute name="Plugin-Description" value="Allows the user to anonymize timestamps and delete parts of huge GPX tracks very fast." />
61 <attribute name="Plugin-Icon" value="images/mapmode/editgpx_mode.png"/>
62 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/EditGpx" />
63 <attribute name="Plugin-Mainversion" value="${plugin.main.version}" />
64 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
65 </manifest>
66 </jar>
67 </target>
68 <target name="revision">
69 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
70 <env key="LANG" value="C"/>
71 <arg value="info"/>
72 <arg value="--xml"/>
73 <arg value="."/>
74 </exec>
75 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
76 <delete file="REVISION"/>
77 </target>
78 <target name="clean">
79 <delete dir="${plugin.build.dir}"/>
80 <delete file="${plugin.jar}"/>
81 </target>
82 <target name="install" depends="dist">
83 <property environment="env"/>
84 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
85 <and>
86 <os family="windows"/>
87 </and>
88 </condition>
89 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
90 </target>
91
92 <!--
93 ************************** Publishing the plugin ***********************************
94 -->
95 <!--
96 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
97 ** property ${coreversion.info.entry.revision}
98 **
99 -->
100 <target name="core-info">
101 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
102 <env key="LANG" value="C"/>
103 <arg value="info"/>
104 <arg value="--xml"/>
105 <!-- <arg value="../../core"/>-->
106 <arg value="../JOSM"/>
107 </exec>
108 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
109 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
110 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
111 <delete file="core.info.xml" />
112 </target>
113
114 <!--
115 ** commits the source tree for this plugin
116 -->
117 <target name="commit-current">
118 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
119 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
120 <env key="LANG" value="C"/>
121 <arg value="commit"/>
122 <arg value="-m '${commit.message}'"/>
123 <arg value="."/>
124 </exec>
125 </target>
126
127 <!--
128 ** updates (svn up) the source tree for this plugin
129 -->
130 <target name="update-current">
131 <echo>Updating plugin source ...</echo>
132 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
133 <env key="LANG" value="C"/>
134 <arg value="up"/>
135 <arg value="."/>
136 </exec>
137 <echo>Updating ${plugin.jar} ...</echo>
138 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
139 <env key="LANG" value="C"/>
140 <arg value="up"/>
141 <arg value="../dist/${plugin.jar}"/>
142 </exec>
143 </target>
144
145 <!--
146 ** commits the plugin.jar
147 -->
148 <target name="commit-dist">
149 <echo>
150***** Properties of published ${plugin.jar} *****
151Commit message : '${commit.message}'
152Plugin-Mainversion: ${plugin.main.version}
153JOSM build version: ${coreversion.info.entry.revision}
154Plugin-Version : ${version.entry.commit.revision}
155***** / Properties of published ${plugin.jar} *****
156
157Now commiting ${plugin.jar} ...
158</echo>
159 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
160 <env key="LANG" value="C"/>
161 <arg value="-m '${commit.message}'"/>
162 <arg value="commit"/>
163 <arg value="${plugin.jar}"/>
164 </exec>
165 </target>
166
167 <!-- ** make sure svn is present as a command line tool ** -->
168 <target name="ensure-svn-present">
169 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
170 <env key="LANG" value="C" />
171 <arg value="--version" />
172 </exec>
173 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
174 <!-- return code not set at all? Most likely svn isn't installed -->
175 <condition>
176 <not>
177 <isset property="svn.exit.code" />
178 </not>
179 </condition>
180 </fail>
181 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
182 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
183 <condition>
184 <isfailure code="${svn.exit.code}" />
185 </condition>
186 </fail>
187 </target>
188
189 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
190 </target>
191</project>
Note: See TracBrowser for help on using the repository browser.