1 | <project name="nearclick" default="dist" basedir=".">
|
---|
2 |
|
---|
3 | <!-- compilation properties -->
|
---|
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"/>
|
---|
8 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
9 | <property name="plugin.name" value="${ant.project.name}"/>
|
---|
10 | <property name="plugin.jar" value="../../dist/${plugin.name}.jar"/>
|
---|
11 |
|
---|
12 | <!-- There's no josm.jar in the svn, so point "josm" to a local copy of your JOSM binary -->
|
---|
13 | <property name="josm" location="../../core/dist/josm-custom.jar" />
|
---|
14 | <!--<property name="josm" location="../josm/josm-latest.jar" ></property>-->
|
---|
15 |
|
---|
16 | <!-- target directory to place the plugin in -->
|
---|
17 | <!-- Windows has a different home directory scheme then unix/linux -->
|
---|
18 | <!-- I don't know an automatic way to find it with ant :-(, if you know, please fix -->
|
---|
19 | <!--<property name="plugins" location="${user.home}/.josm/plugins" ></property>-->
|
---|
20 | <property name="plugins" location="${user.home}/Application Data/JOSM/plugins" ></property>
|
---|
21 |
|
---|
22 | <!-- you should not need to modify anything below this! -->
|
---|
23 |
|
---|
24 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
25 |
|
---|
26 |
|
---|
27 | <target name="init">
|
---|
28 | <mkdir dir="build"></mkdir>
|
---|
29 | <mkdir dir="dist"></mkdir>
|
---|
30 | </target>
|
---|
31 |
|
---|
32 | <target name="compile" depends="init">
|
---|
33 | <echo message="creating ${plugin.jar}"/>
|
---|
34 | <javac srcdir="src" target="1.5" classpath="${josm}" destdir="build" debug="true">
|
---|
35 | <include name="**/*.java" />
|
---|
36 | </javac>
|
---|
37 | </target>
|
---|
38 |
|
---|
39 | <target name="dist" depends="compile">
|
---|
40 | <!-- define the version of the jar file -->
|
---|
41 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
---|
42 | <env key="LANG" value="C"/>
|
---|
43 | <arg value="info"/>
|
---|
44 | <arg value="--xml"/>
|
---|
45 | <arg value="."/>
|
---|
46 | </exec>
|
---|
47 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
48 | <!-- delete intermediate file -->
|
---|
49 | <delete file="REVISION"/>
|
---|
50 | <jar destfile="${plugin.jar}" basedir="build">
|
---|
51 | <manifest>
|
---|
52 | <attribute name="Plugin-Class" value="nearclick.NearClickPlugin" />
|
---|
53 | <attribute name="Plugin-Description" value="Simulates a click when you do a small and short drag. This is usefull for tablet pens, when you have problems just clicking the tablet without the mouse moving (general Java - tablet problem)." />
|
---|
54 | <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
|
---|
55 | </manifest>
|
---|
56 | </jar>
|
---|
57 | </target>
|
---|
58 |
|
---|
59 | <target name="clean">
|
---|
60 | <delete dir="${plugin.build.dir}" />
|
---|
61 | <delete file="${plugin.jar}" />
|
---|
62 | </target>
|
---|
63 |
|
---|
64 | <target name="clean_install">
|
---|
65 | <delete file="${plugins}/nearclick.jar" />
|
---|
66 | </target>
|
---|
67 |
|
---|
68 | <target name="install" depends="dist">
|
---|
69 | <copy file="${plugin.jar}" todir="${plugins}"/>
|
---|
70 | </target>
|
---|
71 |
|
---|
72 | </project>
|
---|