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