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