1 | <project name="graphview" default="dist" basedir=".">
|
---|
2 |
|
---|
3 | <property name="josm" location="../../core/dist/josm-custom.jar"/>
|
---|
4 | <property name="plugin.build.dir" value="build"/>
|
---|
5 | <property name="plugin.src.dir" value="src"/>
|
---|
6 | <!-- this is the directory where the plugin jar is copied to -->
|
---|
7 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
8 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
9 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
10 | <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
|
---|
11 |
|
---|
12 | <!--
|
---|
13 | **********************************************************
|
---|
14 | ** init - initializes the build
|
---|
15 | **********************************************************
|
---|
16 | -->
|
---|
17 | <target name="init">
|
---|
18 | <mkdir dir="${plugin.build.dir}"/>
|
---|
19 | </target>
|
---|
20 |
|
---|
21 | <!--
|
---|
22 | **********************************************************
|
---|
23 | ** compile - complies the source tree
|
---|
24 | **********************************************************
|
---|
25 | -->
|
---|
26 | <target name="compile" depends="init">
|
---|
27 | <echo message="compiling sources for ${plugin.jar} ... "/>
|
---|
28 | <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
|
---|
29 | <compilerarg value="-Xlint:deprecation"/>
|
---|
30 | <compilerarg value="-Xlint:unchecked"/>
|
---|
31 | </javac>
|
---|
32 | </target>
|
---|
33 |
|
---|
34 | <!--
|
---|
35 | **********************************************************
|
---|
36 | ** dist - creates the plugin jar
|
---|
37 | **********************************************************
|
---|
38 | -->
|
---|
39 | <target name="dist" depends="compile,revision">
|
---|
40 | <echo message="creating ${plugin.jar} ... "/>
|
---|
41 | <copy todir="${plugin.build.dir}/images">
|
---|
42 | <fileset dir="images"/>
|
---|
43 | </copy>
|
---|
44 | <copy todir="${plugin.build.dir}/files">
|
---|
45 | <fileset dir="files"/>
|
---|
46 | </copy>
|
---|
47 | <copy todir="${plugin.build.dir}">
|
---|
48 | <fileset dir=".">
|
---|
49 | <include name="LICENSE" />
|
---|
50 | </fileset>
|
---|
51 | </copy>
|
---|
52 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
---|
53 | <manifest>
|
---|
54 | <attribute name="Author" value="Tobias Knerr"/>
|
---|
55 | <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.graphview.plugin.GraphViewPlugin"/>
|
---|
56 | <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
|
---|
57 | <attribute name="Plugin-Description" value="Visualizes routing information as a routing graph."/>
|
---|
58 | <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Graphview"/>
|
---|
59 | <attribute name="Plugin-Mainversion" value="2381"/>
|
---|
60 | <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
|
---|
61 | </manifest>
|
---|
62 | </jar>
|
---|
63 | </target>
|
---|
64 |
|
---|
65 | <!--
|
---|
66 | **********************************************************
|
---|
67 | ** revision - extracts the current revision number for the
|
---|
68 | ** file build.number and stores it in the XML property
|
---|
69 | ** version.*
|
---|
70 | **********************************************************
|
---|
71 | -->
|
---|
72 | <target name="revision">
|
---|
73 |
|
---|
74 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
---|
75 | <env key="LANG" value="C"/>
|
---|
76 | <arg value="info"/>
|
---|
77 | <arg value="--xml"/>
|
---|
78 | <arg value="."/>
|
---|
79 | </exec>
|
---|
80 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
81 | <delete file="REVISION"/>
|
---|
82 | </target>
|
---|
83 |
|
---|
84 | <!--
|
---|
85 | **********************************************************
|
---|
86 | ** clean - clean up the build environment
|
---|
87 | **********************************************************
|
---|
88 | -->
|
---|
89 | <target name="clean">
|
---|
90 | <delete dir="${plugin.build.dir}"/>
|
---|
91 | <delete file="${plugin.jar}"/>
|
---|
92 | </target>
|
---|
93 |
|
---|
94 | <!--
|
---|
95 | **********************************************************
|
---|
96 | ** install - install the plugin in your local JOSM installation
|
---|
97 | **********************************************************
|
---|
98 | -->
|
---|
99 | <target name="install" depends="dist">
|
---|
100 | <property environment="env"/>
|
---|
101 | <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
|
---|
102 | <and>
|
---|
103 | <os family="windows"/>
|
---|
104 | </and>
|
---|
105 | </condition>
|
---|
106 | <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
|
---|
107 | </target>
|
---|
108 | </project>
|
---|