source: osm/applications/editors/josm/plugins/proj4j/build.xml@ 29937

Last change on this file since 29937 was 29854, checked in by donvip, 11 years ago

[josm_plugins] fix #8987 - bump min JOSM version of nearly all plugins to r6162 + code update/cleanup, fix warnings

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