1 | <project name="routing" default="dist" basedir=".">
|
---|
2 | <!-- Define some properties -->
|
---|
3 | <property name="josm" location="../../core/dist/josm-custom.jar"/>
|
---|
4 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
5 | <property name="plugin.build.dir" value="build"/>
|
---|
6 | <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
|
---|
7 | <property name="jgrapht" value="lib/jgrapht-jdk1.5.jar"/>
|
---|
8 | <property name="log4j" value="lib/log4j-1.2.15.jar"/>
|
---|
9 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
10 | <!-- Some initializations for several other targets -->
|
---|
11 | <target name="init">
|
---|
12 | <mkdir dir="${plugin.build.dir}"/>
|
---|
13 | </target>
|
---|
14 | <!-- Compile sources -->
|
---|
15 | <target name="compile" depends="init" description="Compile sources">
|
---|
16 | <echo message="creating ${plugin.jar}"/>
|
---|
17 | <javac srcdir="src" debug="true" destdir="${plugin.build.dir}">
|
---|
18 | <compilerarg value="-Xlint:deprecation"/>
|
---|
19 | <compilerarg value="-Xlint:unchecked"/>
|
---|
20 | <classpath>
|
---|
21 | <pathelement location="${josm}"/>
|
---|
22 | <pathelement location="${jgrapht}"/>
|
---|
23 | <pathelement location="${log4j}"/>
|
---|
24 | </classpath>
|
---|
25 | </javac>
|
---|
26 | </target>
|
---|
27 | <!-- Generate distribution -->
|
---|
28 | <target name="dist" depends="compile,revision" description="Generate distribution">
|
---|
29 | <unjar dest="${plugin.build.dir}" src="${jgrapht}"/>
|
---|
30 | <unjar dest="${plugin.build.dir}" src="${log4j}"/>
|
---|
31 | <copy todir="${plugin.build.dir}/">
|
---|
32 | <fileset dir="resources">
|
---|
33 | <include name="*.xml"/>
|
---|
34 | </fileset>
|
---|
35 | </copy>
|
---|
36 | <copy todir="${plugin.build.dir}/images">
|
---|
37 | <fileset dir="images"/>
|
---|
38 | </copy>
|
---|
39 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
---|
40 | <manifest>
|
---|
41 | <attribute name="Author" value="Jose Vidal <vidalfree@gmail.com>, Juangui Jordán <juangui@gmail.com>"/>
|
---|
42 | <attribute name="Plugin-Class" value="com.innovant.josm.plugin.routing.RoutingPlugin"/>
|
---|
43 | <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
|
---|
44 | <attribute name="Plugin-Description" value="Provides routing capabilities."/>
|
---|
45 | <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Routing"/>
|
---|
46 | <attribute name="Plugin-Mainversion" value="2082"/>
|
---|
47 | <attribute name="Plugin-Stage" value="50"/>
|
---|
48 | <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
|
---|
49 | </manifest>
|
---|
50 | </jar>
|
---|
51 | </target>
|
---|
52 | <target name="revision">
|
---|
53 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
---|
54 | <env key="LANG" value="C"/>
|
---|
55 | <arg value="info"/>
|
---|
56 | <arg value="--xml"/>
|
---|
57 | <arg value="."/>
|
---|
58 | </exec>
|
---|
59 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
60 | <delete file="REVISION"/>
|
---|
61 | </target>
|
---|
62 | <target name="clean">
|
---|
63 | <delete dir="${plugin.build.dir}"/>
|
---|
64 | <delete file="${plugin.jar}"/>
|
---|
65 | </target>
|
---|
66 | <target name="install" depends="dist">
|
---|
67 | <property environment="env"/>
|
---|
68 | <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
|
---|
69 | <and>
|
---|
70 | <os family="windows"/>
|
---|
71 | </and>
|
---|
72 | </condition>
|
---|
73 | <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
|
---|
74 | </target>
|
---|
75 | </project>
|
---|