1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <!--
|
---|
3 | ** This is the build file for the junctionchecking 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="junctionchecking" default="dist" basedir=".">
|
---|
28 |
|
---|
29 | <property name="commit.message" value="Changed the constructor signature of the plugin main class" />
|
---|
30 | <property name="plugin.main.version" value="3751" />
|
---|
31 |
|
---|
32 | <property name="josm" location="../../core/dist/josm-custom.jar" />
|
---|
33 | <property name="plugin.build.dir" value="build" />
|
---|
34 | <property name="plugin.src.dir" value="src" />
|
---|
35 | <!-- this is the directory where the plugin jar is copied to -->
|
---|
36 | <property name="plugin.dist.dir" value="../../dist" />
|
---|
37 | <property name="ant.build.javac.target" value="1.5" />
|
---|
38 | <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar" />
|
---|
39 |
|
---|
40 | <!--
|
---|
41 | **********************************************************
|
---|
42 | ** init - initializes the build
|
---|
43 | **********************************************************
|
---|
44 | -->
|
---|
45 | <target name="init">
|
---|
46 | <mkdir dir="${plugin.build.dir}" />
|
---|
47 | </target>
|
---|
48 |
|
---|
49 | <!--
|
---|
50 | **********************************************************
|
---|
51 | ** compile - complies the source tree
|
---|
52 | **********************************************************
|
---|
53 | -->
|
---|
54 | <target name="compile" depends="init">
|
---|
55 | <echo message="compiling sources for ${plugin.jar} ... " />
|
---|
56 | <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
|
---|
57 | <compilerarg value="-Xlint:deprecation" />
|
---|
58 | <compilerarg value="-Xlint:unchecked" />
|
---|
59 | </javac>
|
---|
60 | </target>
|
---|
61 |
|
---|
62 | <!--
|
---|
63 | **********************************************************
|
---|
64 | ** dist - creates the plugin jar
|
---|
65 | **********************************************************
|
---|
66 | -->
|
---|
67 | <!-- <target name="dist" depends="compile,revision">
|
---|
68 | -->
|
---|
69 | <target name="dist" depends="compile, revision">
|
---|
70 | <echo message="creating ${plugin.jar} ... " />
|
---|
71 | <copy todir="${plugin.build.dir}/resources">
|
---|
72 | <fileset dir="resources" />
|
---|
73 | </copy>
|
---|
74 | <copy todir="${plugin.build.dir}/images">
|
---|
75 | <fileset dir="images" />
|
---|
76 | </copy>
|
---|
77 | <copy todir="${plugin.build.dir}">
|
---|
78 | <fileset dir=".">
|
---|
79 | <include name="LICENSE" />
|
---|
80 | <include name="README" />
|
---|
81 | </fileset>
|
---|
82 | </copy>
|
---|
83 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
---|
84 | <manifest>
|
---|
85 | <attribute name="Author" value="Jörg Possin" />
|
---|
86 | <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.JunctionChecker.JunctionCheckerPlugin" />
|
---|
87 | <attribute name="Plugin-Date" value="${version.entry.commit.date}" />
|
---|
88 | <attribute name="Plugin-Description" value="creates a channel digraph and checks a subset of channels if it is a junction or searches in a subset of channels for junctions" />
|
---|
89 | <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/JunctionChecking" />
|
---|
90 | <attribute name="Plugin-Mainversion" value="${plugin.main.version}" />
|
---|
91 | <attribute name="Plugin-Version" value="${version.entry.commit.revision}" />
|
---|
92 | <attribute name="Plugin-Icon" value="images/dialogs/junctionchecker.png" />
|
---|
93 | <attribute name="Class-Path" value="resources/" />
|
---|
94 | <attribute name="Main-Class" value="org.openstreetmap.josm.plugins.JunctionChecker.commandlineinterface.CLI" />
|
---|
95 | </manifest>
|
---|
96 | </jar>
|
---|
97 | </target>
|
---|
98 |
|
---|
99 | <!--
|
---|
100 | **********************************************************
|
---|
101 | ** revision - extracts the current revision number for the
|
---|
102 | ** file build.number and stores it in the XML property
|
---|
103 | ** version.*
|
---|
104 | **********************************************************
|
---|
105 | -->
|
---|
106 | <target name="revision">
|
---|
107 |
|
---|
108 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
---|
109 | <env key="LANG" value="C"/>
|
---|
110 | <arg value="info"/>
|
---|
111 | <arg value="--xml"/>
|
---|
112 | <arg value="."/>
|
---|
113 | </exec>
|
---|
114 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
115 | <delete file="REVISION"/>
|
---|
116 | </target>
|
---|
117 |
|
---|
118 | <!--
|
---|
119 | **********************************************************
|
---|
120 | ** clean - clean up the build environment
|
---|
121 | **********************************************************
|
---|
122 | -->
|
---|
123 | <target name="clean">
|
---|
124 | <delete dir="${plugin.build.dir}"/>
|
---|
125 | <delete file="${plugin.jar}" />
|
---|
126 | </target>
|
---|
127 |
|
---|
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 |
|
---|
144 | <!--
|
---|
145 | ************************** Publishing the plugin ***********************************
|
---|
146 | -->
|
---|
147 | <!--
|
---|
148 | ** extracts the JOSM release for the JOSM version in ../core and saves it in the
|
---|
149 | ** property ${coreversion.info.entry.revision}
|
---|
150 | **
|
---|
151 | -->
|
---|
152 | <target name="core-info">
|
---|
153 | <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
|
---|
154 | <env key="LANG" value="C" />
|
---|
155 | <arg value="info" />
|
---|
156 | <arg value="--xml" />
|
---|
157 | <arg value="../../core" />
|
---|
158 | </exec>
|
---|
159 | <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true" />
|
---|
160 | <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
|
---|
161 | <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
|
---|
162 | <delete file="core.info.xml" />
|
---|
163 | </target>
|
---|
164 |
|
---|
165 | <!--
|
---|
166 | ** commits the source tree for this plugin
|
---|
167 | -->
|
---|
168 | <target name="commit-current">
|
---|
169 | <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
|
---|
170 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
171 | <env key="LANG" value="C" />
|
---|
172 | <arg value="commit" />
|
---|
173 | <arg value="-m '${commit.message}'" />
|
---|
174 | <arg value="." />
|
---|
175 | </exec>
|
---|
176 | </target>
|
---|
177 |
|
---|
178 | <!--
|
---|
179 | ** updates (svn up) the source tree for this plugin
|
---|
180 | -->
|
---|
181 | <target name="update-current">
|
---|
182 | <echo>Updating plugin source ...</echo>
|
---|
183 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
184 | <env key="LANG" value="C" />
|
---|
185 | <arg value="up" />
|
---|
186 | <arg value="." />
|
---|
187 | </exec>
|
---|
188 | <echo>Updating ${plugin.jar} ...</echo>
|
---|
189 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
190 | <env key="LANG" value="C" />
|
---|
191 | <arg value="up" />
|
---|
192 | <arg value="../dist/${plugin.jar}" />
|
---|
193 | </exec>
|
---|
194 | </target>
|
---|
195 |
|
---|
196 | <!--
|
---|
197 | ** commits the plugin.jar
|
---|
198 | -->
|
---|
199 | <target name="commit-dist">
|
---|
200 | <echo>
|
---|
201 | ***** Properties of published ${plugin.jar} *****
|
---|
202 | Commit message : '${commit.message}'
|
---|
203 | Plugin-Mainversion: ${plugin.main.version}
|
---|
204 | JOSM build version: ${coreversion.info.entry.revision}
|
---|
205 | Plugin-Version : ${version.entry.commit.revision}
|
---|
206 | ***** / Properties of published ${plugin.jar} *****
|
---|
207 |
|
---|
208 | Now commiting ${plugin.jar} ...
|
---|
209 | </echo>
|
---|
210 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
211 | <env key="LANG" value="C" />
|
---|
212 | <arg value="-m '${commit.message}'" />
|
---|
213 | <arg value="commit" />
|
---|
214 | <arg value="${plugin.jar}" />
|
---|
215 | </exec>
|
---|
216 | </target>
|
---|
217 |
|
---|
218 | <!-- ** make sure svn is present as a command line tool ** -->
|
---|
219 | <target name="ensure-svn-present">
|
---|
220 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
|
---|
221 | <env key="LANG" value="C" />
|
---|
222 | <arg value="--version" />
|
---|
223 | </exec>
|
---|
224 | <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
|
---|
225 | <!-- return code not set at all? Most likely svn isn't installed -->
|
---|
226 | <condition>
|
---|
227 | <not>
|
---|
228 | <isset property="svn.exit.code" />
|
---|
229 | </not>
|
---|
230 | </condition>
|
---|
231 | </fail>
|
---|
232 | <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
|
---|
233 | <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
|
---|
234 | <condition>
|
---|
235 | <isfailure code="${svn.exit.code}" />
|
---|
236 | </condition>
|
---|
237 | </fail>
|
---|
238 | </target>
|
---|
239 |
|
---|
240 | <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
|
---|
241 | </target>
|
---|
242 | </project>
|
---|