| 1 | <project name="surveyor" 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="livegpsplugin.jar" value="../../dist/livegps.jar"/>
|
|---|
| 21 |
|
|---|
| 22 | <property name="plugin.description" value="Allow adding markers/nodes on current gps positions."/>
|
|---|
| 23 | <property name="plugin.stage" value="60"/>
|
|---|
| 24 | <property name="plugin.class" value="at.dallermassl.josm.plugin.surveyor.SurveyorPlugin"/>
|
|---|
| 25 |
|
|---|
| 26 | <property name="ant.build.javac.target" value="1.5"/>
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 | <target name="dist" depends="compile">
|
|---|
| 30 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
|---|
| 31 | <env key="LANG" value="C"/>
|
|---|
| 32 | <arg value="info"/>
|
|---|
| 33 | <arg value="--xml"/>
|
|---|
| 34 | <arg value="."/>
|
|---|
| 35 | </exec>
|
|---|
| 36 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
|---|
| 37 | <delete file="REVISION"/>
|
|---|
| 38 |
|
|---|
| 39 | <!-- images -->
|
|---|
| 40 | <copy todir="${plugin.build.dir}/">
|
|---|
| 41 | <fileset dir="resources">
|
|---|
| 42 | <include name="*.xml"/>
|
|---|
| 43 | <include name="audio/*"/>
|
|---|
| 44 | </fileset>
|
|---|
| 45 | </copy>
|
|---|
| 46 |
|
|---|
| 47 | <!-- create jar file -->
|
|---|
| 48 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
|---|
| 49 | <manifest>
|
|---|
| 50 | <attribute name="Plugin-Class" value="${plugin.class}" />
|
|---|
| 51 | <attribute name="Plugin-Description" value="${plugin.description}" />
|
|---|
| 52 | <attribute name="Plugin-Stage" value="${plugin.stage}" />
|
|---|
| 53 | <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
|
|---|
| 54 | <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
|
|---|
| 55 | </manifest>
|
|---|
| 56 | </jar>
|
|---|
| 57 | </target>
|
|---|
| 58 |
|
|---|
| 59 | <target name="compile" depends="init">
|
|---|
| 60 | <echo message="creating ${plugin.jar}"/>
|
|---|
| 61 | <mkdir dir="${plugin.build.dir}"/>
|
|---|
| 62 | <copy todir="build/images" >
|
|---|
| 63 | <fileset dir="images" />
|
|---|
| 64 | </copy>
|
|---|
| 65 | <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
|
|---|
| 66 | <compilerarg value="-Xlint:deprecation"/>
|
|---|
| 67 | <compilerarg value="-Xlint:unchecked"/>
|
|---|
| 68 | <classpath>
|
|---|
| 69 | <pathelement path="${josm.build.dir}/build"/>
|
|---|
| 70 | <fileset dir="${josm.build.dir}/lib">
|
|---|
| 71 | <include name="**/*.jar"/>
|
|---|
| 72 | </fileset>
|
|---|
| 73 | <pathelement location="${livegpsplugin.jar}"/>
|
|---|
| 74 | </classpath>
|
|---|
| 75 | </javac>
|
|---|
| 76 | </target>
|
|---|
| 77 |
|
|---|
| 78 | <target name="install" depends="dist">
|
|---|
| 79 | <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
|
|---|
| 80 | </target>
|
|---|
| 81 |
|
|---|
| 82 | <target name="init">
|
|---|
| 83 | <echo>java version: ${java.version}</echo>
|
|---|
| 84 | </target>
|
|---|
| 85 |
|
|---|
| 86 | <target name="clean">
|
|---|
| 87 | <delete dir="${plugin.build.dir}" />
|
|---|
| 88 | <delete file="${plugin.jar}" />
|
|---|
| 89 | </target>
|
|---|
| 90 | </project>
|
|---|