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