source: osm/applications/editors/josm/plugins/wms-turbo-challenge2/build.xml@ 21804

Last change on this file since 21804 was 21706, checked in by bastik, 14 years ago

add icon links

File size: 4.7 KB
Line 
1<!--
2** To build it run
3**
4** > ant dist
5**
6** To install the generated plugin locally (in you default plugin directory) run
7**
8** > ant install
9-->
10<project name="wms-turbo-challenge2" default="dist" basedir=".">
11 <property name="josm" location="../../core/dist/josm-custom.jar"/>
12 <property name="plugin.build.dir" value="build"/>
13 <property name="plugin.src.dir" value="src"/>
14 <!-- this is the directory where the plugin jar is copied to -->
15 <property name="ant.build.javac.target" value="1.5"/>
16 <property name="plugin.dist.dir" value="../../dist"/>
17 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
18 <property name="wmsplugin" location="${plugin.dist.dir}/wmsplugin.jar:${user.home}/.josm/plugins/wmsplugin.jar"/>
19
20 <!--
21 **********************************************************
22 ** init - initializes the build
23 **********************************************************
24 -->
25 <target name="init">
26 <mkdir dir="${plugin.build.dir}"/>
27 </target>
28
29 <!--
30 **********************************************************
31 ** compile - compiles the source tree
32 **********************************************************
33 -->
34 <target name="compile" depends="init">
35 <echo message="compiling sources for ${plugin.jar} ... "/>
36 <javac srcdir="src" classpath="${josm}:${wmsplugin}" debug="true" destdir="${plugin.build.dir}">
37 <compilerarg value="-Xlint:deprecation"/>
38 <compilerarg value="-Xlint:unchecked"/>
39 </javac>
40 </target>
41
42 <!--
43 **********************************************************
44 ** dist - creates the plugin jar
45 **********************************************************
46 -->
47 <target name="dist" depends="compile,revision">
48 <echo message="creating ${plugin.jar.name} ... "/>
49 <copy todir="${plugin.build.dir}/resources">
50 <fileset dir="resources"/>
51 </copy>
52 <copy todir="${plugin.build.dir}/images">
53 <fileset dir="images"/>
54 </copy>
55 <copy todir="${plugin.build.dir}">
56 <fileset dir=".">
57 <include name="README" />
58 <include name="LICENSE" />
59 </fileset>
60 </copy>
61 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
62 <manifest>
63 <attribute name="Author" value="Andrzej Zaborowski"/>
64 <attribute name="Plugin-Class" value="wmsturbochallenge.WMSRacer"/>
65 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
66 <attribute name="Plugin-Description" value="Drive a race car from point A to point B over aerial imagery, leave cacti behind."/>
67 <attribute name="Plugin-Icon" value="images/wmsracer.png"/>
68 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/WMS_Racer"/>
69 <attribute name="Plugin-Mainversion" value="3252"/>
70 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
71 </manifest>
72 </jar>
73 </target>
74
75 <!--
76 **********************************************************
77 ** revision - extracts the current revision number for the
78 ** file build.number and stores it in the XML property
79 ** version.*
80 **********************************************************
81 -->
82 <target name="revision">
83
84 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
85 <env key="LANG" value="C"/>
86 <arg value="info"/>
87 <arg value="--xml"/>
88 <arg value="."/>
89 </exec>
90 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
91 <delete file="REVISION"/>
92 </target>
93
94 <!--
95 **********************************************************
96 ** clean - clean up the build environment
97 **********************************************************
98 -->
99 <target name="clean">
100 <delete dir="${plugin.build.dir}"/>
101 <delete file="${plugin.jar}"/>
102 </target>
103
104 <!--
105 **********************************************************
106 ** install - install the plugin in your local JOSM installation
107 **********************************************************
108 -->
109 <target name="install" depends="dist">
110 <property environment="env"/>
111 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
112 <and>
113 <os family="windows"/>
114 </and>
115 </condition>
116 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
117 </target>
118</project>
Note: See TracBrowser for help on using the repository browser.