| 1 | <?xml version="1.0" encoding="UTF-8"?>
|
|---|
| 2 |
|
|---|
| 3 | <project name="toms" default="dist" basedir=".">
|
|---|
| 4 | <!--
|
|---|
| 5 | ************************************************
|
|---|
| 6 | ** should not be necessary to change the following properties
|
|---|
| 7 | -->
|
|---|
| 8 | <property name="josm" location="../../core/dist/josm-custom.jar"/>
|
|---|
| 9 | <property name="plugin.build.dir" value="build"/>
|
|---|
| 10 | <property name="plugin.src.dir" value="src"/>
|
|---|
| 11 | <!-- this is the directory where the plugin jar is copied to -->
|
|---|
| 12 | <property name="plugin.dist.dir" value="../../dist"/>
|
|---|
| 13 | <property name="ant.build.javac.target" value="1.5"/>
|
|---|
| 14 | <property name="plugin.dist.dir" value="../../dist"/>
|
|---|
| 15 | <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
|
|---|
| 16 | <property name="plugpath" value="../../../josm"/>
|
|---|
| 17 | <property name="manifest" value= "log4j-1.2.16.jar
|
|---|
| 18 | toms.jar"/>
|
|---|
| 19 |
|
|---|
| 20 | <!--
|
|---|
| 21 | **********************************************************
|
|---|
| 22 | ** init - initializes the build
|
|---|
| 23 | **********************************************************
|
|---|
| 24 | -->
|
|---|
| 25 | <target name="init">
|
|---|
| 26 | <mkdir dir="${plugin.build.dir}"/>
|
|---|
| 27 | </target>
|
|---|
| 28 |
|
|---|
| 29 | <!--
|
|---|
| 30 | **********************************************************
|
|---|
| 31 | ** compile - complies the source tree
|
|---|
| 32 | **********************************************************
|
|---|
| 33 | -->
|
|---|
| 34 | <target name="compile" depends="init">
|
|---|
| 35 | <echo message="classpath = ${josm}"/>
|
|---|
| 36 | <echo message="compiling sources for ${plugin.jar} ... "/>
|
|---|
| 37 | <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
|
|---|
| 38 | <compilerarg value="-Xlint:deprecation"/>
|
|---|
| 39 | <compilerarg value="-Xlint:unchecked"/>
|
|---|
| 40 | </javac>
|
|---|
| 41 | </target>
|
|---|
| 42 |
|
|---|
| 43 | <!--
|
|---|
| 44 | **********************************************************
|
|---|
| 45 | ** dist - creates the plugin jar
|
|---|
| 46 | **********************************************************
|
|---|
| 47 | -->
|
|---|
| 48 | <target name="dist" depends="compile">
|
|---|
| 49 | <echo message="creating ${plugin.jar.name} ... "/>
|
|---|
| 50 |
|
|---|
| 51 | <copy todir="${plugin.build.dir}/images">
|
|---|
| 52 | <fileset dir="${plugin.src.dir}/images"/>
|
|---|
| 53 | </copy>
|
|---|
| 54 |
|
|---|
| 55 | <copy todir="${plugin.build.dir}/resources">
|
|---|
| 56 | <fileset dir="resources"/>
|
|---|
| 57 | </copy>
|
|---|
| 58 | <copy todir="${plugin.build.dir}/images">
|
|---|
| 59 | <fileset dir="images"/>
|
|---|
| 60 | </copy>
|
|---|
| 61 | <copy todir="${plugin.build.dir}">
|
|---|
| 62 | <fileset dir=".">
|
|---|
| 63 | <include name="README" />
|
|---|
| 64 | <include name="LICENSE" />
|
|---|
| 65 | </fileset>
|
|---|
| 66 | </copy>
|
|---|
| 67 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
|---|
| 68 | <!--
|
|---|
| 69 | ************************************************
|
|---|
| 70 | ** configure these properties. Most of them will be copied to the plugins
|
|---|
| 71 | ** manifest file. Property values will also show up in the list available
|
|---|
| 72 | ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
|
|---|
| 73 | **
|
|---|
| 74 | ************************************************
|
|---|
| 75 | -->
|
|---|
| 76 | <manifest>
|
|---|
| 77 | <attribute name="Author" value="Werner"/>
|
|---|
| 78 | <attribute name="Plugin-Class" value="toms.Toms"/>
|
|---|
| 79 | <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
|
|---|
| 80 | <attribute name="Plugin-Description" value="Create and edit seamarks for OpenSeaMap"/>
|
|---|
| 81 | <attribute name="Plugin-Link" value="http://openseamap.org/"/>
|
|---|
| 82 | <attribute name="Plugin-Mainversion" value="1465"/>
|
|---|
| 83 | <attribute name="Plugin-Stage" value="100"/>
|
|---|
| 84 | <!-- <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> -->
|
|---|
| 85 | <attribute name="Plugin-Version" value="010"/>
|
|---|
| 86 | <attribute name="Class-Path" value="${manifest}"/>
|
|---|
| 87 | </manifest>
|
|---|
| 88 | </jar>
|
|---|
| 89 | </target>
|
|---|
| 90 |
|
|---|
| 91 | <!--
|
|---|
| 92 | **********************************************************
|
|---|
| 93 | ** clean - clean up the build environment
|
|---|
| 94 | **********************************************************
|
|---|
| 95 | -->
|
|---|
| 96 | <target name="clean">
|
|---|
| 97 | <delete dir="${plugin.build.dir}"/>
|
|---|
| 98 | <delete file="${plugin.jar}"/>
|
|---|
| 99 | </target>
|
|---|
| 100 |
|
|---|
| 101 | <!--
|
|---|
| 102 | **********************************************************
|
|---|
| 103 | ** install - install the plugin in your local JOSM installation
|
|---|
| 104 | **********************************************************
|
|---|
| 105 | -->
|
|---|
| 106 | <target name="install" depends="dist">
|
|---|
| 107 | <property environment="env"/>
|
|---|
| 108 | <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
|
|---|
| 109 | <and>
|
|---|
| 110 | <os family="windows"/>
|
|---|
| 111 | </and>
|
|---|
| 112 | </condition>
|
|---|
| 113 | <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
|
|---|
| 114 | </target>
|
|---|
| 115 | </project>
|
|---|