[8748] | 1 | <project name="openlayers" default="dist" basedir=".">
|
---|
[12780] | 2 | <!-- josm "user home" directory depends on the platform used (windows has a different place than unix/linux) -->
|
---|
| 3 | <property environment="env"/>
|
---|
| 4 | <condition property="josm.home.dir" value="${env.APPDATA}/JOSM" else="${user.home}/.josm">
|
---|
| 5 | <and>
|
---|
| 6 | <os family="windows"/>
|
---|
| 7 | </and>
|
---|
| 8 | </condition>
|
---|
| 9 | <!-- compilation properties -->
|
---|
| 10 | <property name="josm.build.dir" value="../../core"/>
|
---|
| 11 | <property name="josm.plugins.dir" value="${josm.home.dir}/plugins"/>
|
---|
| 12 | <property name="josm" location="../../core/dist/josm-custom.jar" />
|
---|
| 13 | <property name="plugin.build.dir" value="build"/>
|
---|
| 14 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
| 15 | <property name="plugin.name" value="${ant.project.name}"/>
|
---|
| 16 | <property name="plugin.jar" value="../../dist/${plugin.name}.jar"/>
|
---|
| 17 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
| 18 | <!-- All jar files needed -->
|
---|
| 19 | <fileset id="required_libs" dir="lib">
|
---|
| 20 | <include name="cobra.jar"/>
|
---|
| 21 | <include name="js.jar"/>
|
---|
| 22 | <include name="ehcache-1.4.1.jar"/>
|
---|
| 23 | <include name="backport-util-concurrent-3.0.jar"/>
|
---|
| 24 | <!-- needed by ehcache -->
|
---|
| 25 | <include name="commons-logging-1.0.4.jar"/>
|
---|
| 26 | <!--needed by ehcache -->
|
---|
| 27 | </fileset>
|
---|
| 28 | <target name="init">
|
---|
| 29 | <mkdir dir="build"></mkdir>
|
---|
| 30 | <mkdir dir="dist"></mkdir>
|
---|
| 31 | </target>
|
---|
| 32 | <target name="compile" depends="init">
|
---|
| 33 | <echo message="creating ${plugin.jar}"/>
|
---|
| 34 | <javac srcdir="src" debug="true" destdir="build">
|
---|
| 35 | <classpath>
|
---|
| 36 | <path path="../../core/dist/josm-custom.jar"/>
|
---|
| 37 | <fileset refid="required_libs"/>
|
---|
| 38 | </classpath>
|
---|
| 39 | </javac>
|
---|
| 40 | </target>
|
---|
| 41 | <target name="dist" depends="compile">
|
---|
| 42 | <!-- jars -->
|
---|
| 43 | <!-- TODO: instead of adding library code to the plugin jar, JOSM should
|
---|
| 44 | have some kind of library dir loaded in the classpath -->
|
---|
| 45 | <unjar dest="build">
|
---|
| 46 | <fileset refid="required_libs" />
|
---|
| 47 | </unjar>
|
---|
| 48 | <!-- images -->
|
---|
| 49 | <copy todir="build/images">
|
---|
| 50 | <fileset dir="images" />
|
---|
| 51 | </copy>
|
---|
| 52 | <!--resources -->
|
---|
| 53 | <copy todir="build/resources">
|
---|
| 54 | <fileset dir="resources" />
|
---|
| 55 | </copy>
|
---|
| 56 | <!-- create josm-custom.jar -->
|
---|
| 57 | <jar destfile="${plugin.jar}" basedir="build">
|
---|
| 58 | <manifest>
|
---|
| 59 | <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.openLayers.OpenLayersPlugin" />
|
---|
| 60 | <attribute name="Plugin-Description" value="Displays an OpenLayers background image" />
|
---|
| 61 | <attribute name="Class-Path" value="cobra.jar js.jar ehcache-1.4.1.jar commons-logging-1.0.4.jar backport-util-concurrent-3.0.jar" />
|
---|
| 62 | </manifest>
|
---|
| 63 | </jar>
|
---|
| 64 | </target>
|
---|
| 65 | <target name="clean">
|
---|
| 66 | <delete dir="${plugin.build.dir}" />
|
---|
| 67 | <delete file="${plugin.jar}" />
|
---|
| 68 | </target>
|
---|
| 69 | <target name="install" depends="dist">
|
---|
| 70 | <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
|
---|
| 71 | </target>
|
---|
[8748] | 72 | </project>
|
---|