1 | <project name="navigator" default="dist" basedir=".">
|
---|
2 | <!-- compilation properties -->
|
---|
3 | <property name="josm.build.dir" value="../../core"/>
|
---|
4 | <property name="josm.home.dir" value="${user.home}/.josm"/>
|
---|
5 | <property name="josm" location="../../core/dist/josm-custom.jar" />
|
---|
6 | <property name="plugin.build.dir" value="build"/>
|
---|
7 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
8 | <property name="plugin.name" value="${ant.project.name}"/>
|
---|
9 | <property name="plugin.jar" value="../../dist/${plugin.name}.jar"/>
|
---|
10 | <!-- plugin meta data (enter new version number if anything changed!) -->
|
---|
11 | <property name="plugin.version" value="0.3.1"/>
|
---|
12 | <property name="plugin.description" value="Provides navigation/autorouting functionality (V${plugin.version})."/>
|
---|
13 | <property name="plugin.stage" value="50"/>
|
---|
14 | <property name="plugin.class" value="at.dallermassl.josm.plugin.navigator.NavigatorPlugin"/>
|
---|
15 | <!-- update site meta data -->
|
---|
16 | <property name="plugin.site.file" value="josm-site.xml"/>
|
---|
17 | <property name="plugin.site.description" value="Josm's Surveyor Update Site"/>
|
---|
18 | <property name="plugin.site.url" value="http://www.tegmento.org/~cdaller/josm/${ant.project.name}/"/>
|
---|
19 | <property name="plugin.site.upload.target" value="cdaller@www.tegmento.org:public_html/josm/${ant.project.name}/"/>
|
---|
20 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
21 | <target name="dist" depends="compile,site">
|
---|
22 | <!-- images -->
|
---|
23 | <copy todir="${plugin.build.dir}/images">
|
---|
24 | <fileset dir="src/images" />
|
---|
25 | </copy>
|
---|
26 | <!-- copy configuration xml files
|
---|
27 | <copy todir="${plugin.build.dir}">
|
---|
28 | <fileset dir="src">
|
---|
29 | <include name="*.xml"/>
|
---|
30 | </fileset>
|
---|
31 | </copy>
|
---|
32 | -->
|
---|
33 | <!-- create jar file -->
|
---|
34 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
---|
35 | <manifest>
|
---|
36 | <attribute name="Plugin-Class" value="${plugin.class}" />
|
---|
37 | <attribute name="Plugin-Description" value="${plugin.description}" />
|
---|
38 | <attribute name="Plugin-Version" value="${plugin.version}" />
|
---|
39 | <attribute name="Plugin-Dependencies" value="jgrapht-jdk1.5" />
|
---|
40 | <attribute name="Plugin-Stage" value="${plugin.stage}" />
|
---|
41 | </manifest>
|
---|
42 | </jar>
|
---|
43 | </target>
|
---|
44 | <target name="compile" depends="init">
|
---|
45 | <echo message="creating ${plugin.jar}"/>
|
---|
46 | <mkdir dir="${plugin.build.dir}"/>
|
---|
47 | <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
|
---|
48 | <classpath>
|
---|
49 | <pathelement path="${josm.build.dir}/build"/>
|
---|
50 | <fileset dir="${josm.build.dir}/lib">
|
---|
51 | <include name="**/*.jar"/>
|
---|
52 | </fileset>
|
---|
53 | <fileset dir="lib">
|
---|
54 | <include name="**/*.jar"/>
|
---|
55 | </fileset>
|
---|
56 | </classpath>
|
---|
57 | </javac>
|
---|
58 | </target>
|
---|
59 | <target name="install" depends="dist">
|
---|
60 | <copy file="${plugin.jar}" todir="${josm.home.dir}/plugins" />
|
---|
61 | <copy todir="${josm.home.dir}/plugins">
|
---|
62 | <fileset dir="lib">
|
---|
63 | <include name="**/*.jar"/>
|
---|
64 | </fileset>
|
---|
65 | </copy>
|
---|
66 | </target>
|
---|
67 | <target name="init">
|
---|
68 | <echo>java version: ${java.version}</echo>
|
---|
69 | </target>
|
---|
70 | <target name="clean">
|
---|
71 | <delete dir="${plugin.build.dir}" />
|
---|
72 | <delete dir="${plugin.site.file}" />
|
---|
73 | <delete file="${plugin.jar}" />
|
---|
74 | </target>
|
---|
75 | <!-- write site description for the given plugin so josm will accept it -->
|
---|
76 | <target name="site">
|
---|
77 | <echo message="creating site description in ${plugin.site.file}"/>
|
---|
78 | <echo file="${plugin.site.file}"><!-- plugins available on this site -->
|
---|
79 | <plugins>
|
---|
80 | <plugin id="${ant.project.name}" version="${plugin.version}">
|
---|
81 | <name>${ant.project.name}</name>
|
---|
82 | <description>${plugin.description}</description>
|
---|
83 | <resource>${plugin.site.url}${plugin.jar}</resource>
|
---|
84 | </plugin>
|
---|
85 | </plugins>
|
---|
86 | </echo>
|
---|
87 | </target>
|
---|
88 | <!-- write site description for the given plugin (not implemented in JOSM as full version yet!) -->
|
---|
89 | <target name="site-full-donotuse">
|
---|
90 | <echo message="creating site description in ${plugin.site.file}"/>
|
---|
91 | <echo file="${plugin.site.file}"><?xml version="1.0"?>
|
---|
92 | <site version="1.0">
|
---|
93 | <!-- meta data of site -->
|
---|
94 | <site-info>
|
---|
95 | <site-name>${plugin.site.description}</site-name>
|
---|
96 | <site-url>${plugin.site.url}</site-url>
|
---|
97 | </site-info>
|
---|
98 |
|
---|
99 | <!-- plugins available on this site -->
|
---|
100 | <plugins>
|
---|
101 | <plugin id="${ant.project.name}" version="${plugin.version}">
|
---|
102 | <name>${ant.project.name}</name>
|
---|
103 | <description>${plugin.description}</description>
|
---|
104 | <resources>
|
---|
105 | <resource src="${plugin.site.url}${plugin.jar}"
|
---|
106 | target="${josm.home.dir}/plugins/${plugin.jar}"/>
|
---|
107 | </resources>
|
---|
108 | </plugin>
|
---|
109 | </plugins>
|
---|
110 | </site>
|
---|
111 | </echo>
|
---|
112 | </target>
|
---|
113 | <!-- upload the site description and the jar file via ssh -->
|
---|
114 | <target name="upload" depends="dist,site">
|
---|
115 | <echo message="uploading jar and site description to ${plugin.site.upload.target}"/>
|
---|
116 | <exec executable="scp">
|
---|
117 | <arg value="${plugin.jar}"/>
|
---|
118 | <arg value="${plugin.site.file}"/>
|
---|
119 | <arg value="${plugin.site.upload.target}"/>
|
---|
120 | </exec>
|
---|
121 | </target>
|
---|
122 | </project>
|
---|