1 | <project name="surveyor" default="dist" basedir=".">
|
---|
2 |
|
---|
3 | <!-- compilation properties -->
|
---|
4 | <property name="josm.build.dir" value="../../core"/>
|
---|
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="../livegps/livegps.jar"/>
|
---|
10 |
|
---|
11 | <!-- plugin meta data (enter new version number if anything changed!) -->
|
---|
12 | <property name="plugin.version" value="1.3.1"/>
|
---|
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}/">
|
---|
27 | <fileset dir="resources">
|
---|
28 | <include name="*.xml"/>
|
---|
29 | <include name="audio/*"/>
|
---|
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="org.eigenheimstrasse.josm" /-->
|
---|
40 | <attribute name="Plugin-Stage" value="${plugin.stage}" />
|
---|
41 | </manifest>
|
---|
42 | </jar>
|
---|
43 | </target>
|
---|
44 |
|
---|
45 | <target name="compile" depends="init">
|
---|
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 | <pathelement location="${livegpsplugin.jar}"/>
|
---|
54 | </classpath>
|
---|
55 | </javac>
|
---|
56 | </target>
|
---|
57 |
|
---|
58 | <target name="install" depends="dist">
|
---|
59 | <copy file="${plugin.jar}" todir="${josm.home.dir}/plugins" />
|
---|
60 | </target>
|
---|
61 |
|
---|
62 | <target name="init">
|
---|
63 | <echo>java version: ${java.version}</echo>
|
---|
64 | </target>
|
---|
65 |
|
---|
66 | <target name="clean">
|
---|
67 | <delete dir="${plugin.build.dir}" />
|
---|
68 | <delete dir="${plugin.site.file}" />
|
---|
69 | <delete dir="${plugin.jar}" />
|
---|
70 | </target>
|
---|
71 |
|
---|
72 | <!-- write site description for the given plugin so josm will accept it -->
|
---|
73 | <target name="site">
|
---|
74 | <echo message="creating site description in ${plugin.site.file}"/>
|
---|
75 | <echo file="${plugin.site.file}"><!-- plugins available on this site -->
|
---|
76 | <plugins>
|
---|
77 | <plugin id="${ant.project.name}" version="${plugin.version}">
|
---|
78 | <name>${ant.project.name}</name>
|
---|
79 | <description>${plugin.description}</description>
|
---|
80 | <resource>${plugin.site.url}${plugin.jar}</resource>
|
---|
81 | </plugin>
|
---|
82 | </plugins>
|
---|
83 | </echo>
|
---|
84 | </target>
|
---|
85 |
|
---|
86 | <!-- write site description for the given plugin (not implemented in JOSM as full version yet!) -->
|
---|
87 | <target name="site-full-donotuse">
|
---|
88 | <echo message="creating site description in ${plugin.site.file}"/>
|
---|
89 | <echo file="${plugin.site.file}"><?xml version="1.0"?>
|
---|
90 | <site version="1.0">
|
---|
91 | <!-- meta data of site -->
|
---|
92 | <site-info>
|
---|
93 | <site-name>${plugin.site.description}</site-name>
|
---|
94 | <site-url>${plugin.site.url}</site-url>
|
---|
95 | </site-info>
|
---|
96 |
|
---|
97 | <!-- plugins available on this site -->
|
---|
98 | <plugins>
|
---|
99 | <plugin id="${ant.project.name}" version="${plugin.version}">
|
---|
100 | <name>${ant.project.name}</name>
|
---|
101 | <description>${plugin.description}</description>
|
---|
102 | <resources>
|
---|
103 | <resource src="${plugin.site.url}${plugin.jar}"
|
---|
104 | target="${josm.home.dir}/plugins/${plugin.jar}"/>
|
---|
105 | </resources>
|
---|
106 | </plugin>
|
---|
107 | </plugins>
|
---|
108 | </site>
|
---|
109 | </echo>
|
---|
110 | </target>
|
---|
111 |
|
---|
112 |
|
---|
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 |
|
---|
123 | </project>
|
---|