source: osm/applications/editors/josm/plugins/routes/build.xml@ 31586

Last change on this file since 31586 was 31586, checked in by simon04, 9 years ago

JOSM/routes: refactor for breaking search API changes - see #josm11916

  • Property svn:mime-type set to text/xml
File size: 7.4 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<project name="routes" default="dist" basedir=".">
3 <property name="commit.message" value="Changed the constructor signature of the plugin main class"/>
4 <property name="plugin.main.version" value="8811"/>
5 <property name="josm" location="../../core/dist/josm-custom.jar"/>
6 <property name="plugin.dist.dir" value="../../dist"/>
7 <property name="plugin.build.dir" value="build"/>
8 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
9 <property name="ant.build.javac.target" value="1.7"/>
10 <target name="init">
11 <mkdir dir="${plugin.build.dir}"/>
12 </target>
13 <target name="compile" depends="init">
14 <echo message="creating ${plugin.jar}"/>
15 <javac srcdir="src" debug="true" destdir="${plugin.build.dir}" includeantruntime="false">
16 <compilerarg value="-Xlint:deprecation"/>
17 <compilerarg value="-Xlint:unchecked"/>
18 <classpath>
19 <pathelement location="${josm}"/>
20 <fileset dir="lib">
21 <include name="**/*.jar"/>
22 </fileset>
23 </classpath>
24 </javac>
25 <copy file="src/org/openstreetmap/josm/plugins/routes/xml/routes.xml" todir="${plugin.build.dir}/org/openstreetmap/josm/plugins/routes/xml"/>
26 <copy file="src/org/openstreetmap/josm/plugins/routes/xml/routes.xsd" todir="${plugin.build.dir}/org/openstreetmap/josm/plugins/routes/xml"/>
27 </target>
28 <target name="dist" depends="compile,revision">
29 <copy todir="${plugin.build.dir}/data">
30 <fileset dir="data"/>
31 </copy>
32 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
33 <zipfileset src="lib/jsr173-1.0_api.jar" includes="**/*"/>
34 <zipfileset src="lib/jaxb-api.jar" includes="**/*"/>
35 <zipfileset src="lib/jaxb-impl.jar" includes="**/*.class"/>
36 <zipfileset src="lib/activation.jar" includes="**/*.class"/>
37 <manifest>
38 <attribute name="Author" value="Jiri Klement"/>
39 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.routes.RoutesPlugin"/>
40 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
41 <attribute name="Plugin-Description" value="Renders routes (bus, hiking trails, bicycle routes, ..). Route types must be defined in routes.xml file in plugin directory"/>
42 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
43 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
44 </manifest>
45 </jar>
46 </target>
47 <target name="revision">
48 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
49 <env key="LANG" value="C"/>
50 <arg value="info"/>
51 <arg value="--xml"/>
52 <arg value="."/>
53 </exec>
54 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
55 <delete file="REVISION"/>
56 </target>
57 <target name="clean">
58 <delete dir="${plugin.build.dir}"/>
59 <delete file="${plugin.jar}"/>
60 </target>
61 <target name="install" depends="dist">
62 <property environment="env"/>
63 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
64 <and>
65 <os family="windows"/>
66 </and>
67 </condition>
68 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
69 </target>
70 <!--
71 ************************** Publishing the plugin ***********************************
72 -->
73 <!--
74 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
75 ** property ${coreversion.info.entry.revision}
76 **
77 -->
78 <target name="core-info">
79 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
80 <env key="LANG" value="C"/>
81 <arg value="info"/>
82 <arg value="--xml"/>
83 <arg value="../../core"/>
84 </exec>
85 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
86 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
87 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
88 <delete file="core.info.xml"/>
89 </target>
90 <!--
91 ** commits the source tree for this plugin
92 -->
93 <target name="commit-current">
94 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
95 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
96 <env key="LANG" value="C"/>
97 <arg value="commit"/>
98 <arg value="-m '${commit.message}'"/>
99 <arg value="."/>
100 </exec>
101 </target>
102 <!--
103 ** updates (svn up) the source tree for this plugin
104 -->
105 <target name="update-current">
106 <echo>Updating plugin source ...</echo>
107 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
108 <env key="LANG" value="C"/>
109 <arg value="up"/>
110 <arg value="."/>
111 </exec>
112 <echo>Updating ${plugin.jar} ...</echo>
113 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
114 <env key="LANG" value="C"/>
115 <arg value="up"/>
116 <arg value="../dist/${plugin.jar}"/>
117 </exec>
118 </target>
119 <!--
120 ** commits the plugin.jar
121 -->
122 <target name="commit-dist">
123 <echo>
124 ***** Properties of published ${plugin.jar} *****
125 Commit message : '${commit.message}'
126 Plugin-Mainversion: ${plugin.main.version}
127 JOSM build version: ${coreversion.info.entry.revision}
128 Plugin-Version : ${version.entry.commit.revision}
129 ***** / Properties of published ${plugin.jar} *****
130
131 Now commiting ${plugin.jar} ...
132 </echo>
133 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
134 <env key="LANG" value="C"/>
135 <arg value="-m '${commit.message}'"/>
136 <arg value="commit"/>
137 <arg value="${plugin.jar}"/>
138 </exec>
139 </target>
140 <!-- ** make sure svn is present as a command line tool ** -->
141 <target name="ensure-svn-present">
142 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
143 <env key="LANG" value="C"/>
144 <arg value="--version"/>
145 </exec>
146 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
147 <!-- return code not set at all? Most likely svn isn't installed -->
148 <condition>
149 <not>
150 <isset property="svn.exit.code"/>
151 </not>
152 </condition>
153 </fail>
154 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
155 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
156 <condition>
157 <isfailure code="${svn.exit.code}"/>
158 </condition>
159 </fail>
160 </target>
161 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
162 </target>
163</project>
Note: See TracBrowser for help on using the repository browser.