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