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