1 | <project name="openstreetbugs" default="dist" basedir=".">
|
---|
2 |
|
---|
3 | <property file="build.properties"/>
|
---|
4 |
|
---|
5 | <!-- compilation properties -->
|
---|
6 | <property name="josm.build.dir" value="${josm.base.dir}/build" />
|
---|
7 | <property name="josm.home.dir" value="${user.home}/.josm" />
|
---|
8 | <property name="josm" location="${josm.base.dir}/dist/josm-custom.jar" />
|
---|
9 | <property name="lib.dir" value="lib" />
|
---|
10 | <property name="plugin.build.dir" value="build" />
|
---|
11 | <property name="plugin.name" value="${ant.project.name}" />
|
---|
12 | <property name="plugin.jar" value="${plugin.build.dir}/${plugin.name}.jar" />
|
---|
13 |
|
---|
14 | <property name="ant.build.javac.target" value="1.5" />
|
---|
15 |
|
---|
16 | <target name="init">
|
---|
17 | <mkdir dir="${plugin.build.dir}" />
|
---|
18 | </target>
|
---|
19 |
|
---|
20 | <target name="compile" depends="init">
|
---|
21 | <echo message="creating ${plugin.jar}" />
|
---|
22 | <javac srcdir="src" classpath="${josm}" destdir="${plugin.build.dir}" debug="true">
|
---|
23 | <include name="**/*.java" />
|
---|
24 | </javac>
|
---|
25 | </target>
|
---|
26 |
|
---|
27 | <target name="dist" depends="clean, compile">
|
---|
28 | <!-- set build time -->
|
---|
29 | <tstamp>
|
---|
30 | <format property="current.time" pattern="dd.MM.yyyy HH:mm" />
|
---|
31 | </tstamp>
|
---|
32 |
|
---|
33 | <!-- copy images to jar -->
|
---|
34 | <copy todir="${plugin.build.dir}/images">
|
---|
35 | <fileset dir="images" />
|
---|
36 | </copy>
|
---|
37 |
|
---|
38 | <!-- copy language files -->
|
---|
39 | <copy todir="${plugin.build.dir}">
|
---|
40 | <fileset dir="src">
|
---|
41 | <include name="**/*.properties" />
|
---|
42 | </fileset>
|
---|
43 | </copy>
|
---|
44 |
|
---|
45 | <!-- create the jar file -->
|
---|
46 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
---|
47 | <manifest>
|
---|
48 | <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.osb.OsbPlugin" />
|
---|
49 | <attribute name="Plugin-Description" value="Imports issues from OpenStreetBugs" />
|
---|
50 | <attribute name="Plugin-Version" value="${version}" />
|
---|
51 | <attribute name="Plugin-Date" value="${current.time}" />
|
---|
52 | <attribute name="Author" value="Henrik Niehaus" />
|
---|
53 | </manifest>
|
---|
54 | </jar>
|
---|
55 | </target>
|
---|
56 |
|
---|
57 | <!-- clean target -->
|
---|
58 | <target name="clean">
|
---|
59 | <delete dir="build" />
|
---|
60 | </target>
|
---|
61 |
|
---|
62 | <target name="install" depends="dist">
|
---|
63 | <copy file="${plugin.jar}" todir="${user.home}/.josm/plugins" />
|
---|
64 | </target>
|
---|
65 |
|
---|
66 | <target name="test" depends="install">
|
---|
67 | <java jar="${josm}" fork="true">
|
---|
68 | <arg value="${osmfile}" />
|
---|
69 | <jvmarg value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777"/>
|
---|
70 | </java>
|
---|
71 | </target>
|
---|
72 |
|
---|
73 | </project>
|
---|