source: osm/applications/editors/josm/plugins/nearclick/build.xml@ 30334

Last change on this file since 30334 was 29854, checked in by donvip, 12 years ago

[josm_plugins] fix #8987 - bump min JOSM version of nearly all plugins to r6162 + code update/cleanup, fix warnings

  • Property svn:mime-type set to text/xml
File size: 6.9 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<project name="nearclick" default="dist" basedir=".">
3 <!-- enter the SVN commit message -->
4 <property name="commit.message" value="Changed the constructor signature of the plugin main class"/>
5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
6 <property name="plugin.main.version" value="6162"/>
7 <property name="josm" location="../../core/dist/josm-custom.jar"/>
8 <property name="plugin.dist.dir" value="../../dist"/>
9 <property name="plugin.build.dir" value="build"/>
10 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
11 <property name="ant.build.javac.target" value="1.6"/>
12 <target name="init">
13 <mkdir dir="${plugin.build.dir}"/>
14 </target>
15 <target name="compile" depends="init">
16 <echo message="creating ${plugin.jar}"/>
17 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
18 <compilerarg value="-Xlint:deprecation"/>
19 <compilerarg value="-Xlint:unchecked"/>
20 </javac>
21 </target>
22 <target name="dist" depends="compile,revision">
23 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
24 <manifest>
25 <attribute name="Author" value="Imi, David Earl"/>
26 <attribute name="Plugin-Class" value="nearclick.NearClickPlugin"/>
27 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
28 <attribute name="Plugin-Description" value="Simulates a click when you do a small and short drag. This is useful for tablet pens, when you have problems just clicking the tablet without the mouse moving (general Java - tablet problem)."/>
29 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Nearclick"/>
30 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
31 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
32 </manifest>
33 </jar>
34 </target>
35 <target name="revision">
36 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
37 <env key="LANG" value="C"/>
38 <arg value="info"/>
39 <arg value="--xml"/>
40 <arg value="."/>
41 </exec>
42 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
43 <delete file="REVISION"/>
44 </target>
45 <target name="clean">
46 <delete dir="${plugin.build.dir}"/>
47 <delete file="${plugin.jar}"/>
48 </target>
49 <target name="install" depends="dist">
50 <property environment="env"/>
51 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
52 <and>
53 <os family="windows"/>
54 </and>
55 </condition>
56 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
57 </target>
58 <!--
59 ************************** Publishing the plugin ***********************************
60 -->
61 <!--
62 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
63 ** property ${coreversion.info.entry.revision}
64 **
65 -->
66 <target name="core-info">
67 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
68 <env key="LANG" value="C"/>
69 <arg value="info"/>
70 <arg value="--xml"/>
71 <arg value="../../core"/>
72 </exec>
73 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
74 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
75 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
76 <delete file="core.info.xml"/>
77 </target>
78 <!--
79 ** commits the source tree for this plugin
80 -->
81 <target name="commit-current">
82 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
83 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
84 <env key="LANG" value="C"/>
85 <arg value="commit"/>
86 <arg value="-m '${commit.message}'"/>
87 <arg value="."/>
88 </exec>
89 </target>
90 <!--
91 ** updates (svn up) the source tree for this plugin
92 -->
93 <target name="update-current">
94 <echo>Updating plugin source ...</echo>
95 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
96 <env key="LANG" value="C"/>
97 <arg value="up"/>
98 <arg value="."/>
99 </exec>
100 <echo>Updating ${plugin.jar} ...</echo>
101 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
102 <env key="LANG" value="C"/>
103 <arg value="up"/>
104 <arg value="../dist/${plugin.jar}"/>
105 </exec>
106 </target>
107 <!--
108 ** commits the plugin.jar
109 -->
110 <target name="commit-dist">
111 <echo>
112 ***** Properties of published ${plugin.jar} *****
113 Commit message : '${commit.message}'
114 Plugin-Mainversion: ${plugin.main.version}
115 JOSM build version: ${coreversion.info.entry.revision}
116 Plugin-Version : ${version.entry.commit.revision}
117 ***** / Properties of published ${plugin.jar} *****
118
119 Now commiting ${plugin.jar} ...
120 </echo>
121 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
122 <env key="LANG" value="C"/>
123 <arg value="-m '${commit.message}'"/>
124 <arg value="commit"/>
125 <arg value="${plugin.jar}"/>
126 </exec>
127 </target>
128 <!-- ** make sure svn is present as a command line tool ** -->
129 <target name="ensure-svn-present">
130 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
131 <env key="LANG" value="C"/>
132 <arg value="--version"/>
133 </exec>
134 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
135 <!-- return code not set at all? Most likely svn isn't installed -->
136 <condition>
137 <not>
138 <isset property="svn.exit.code"/>
139 </not>
140 </condition>
141 </fail>
142 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
143 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
144 <condition>
145 <isfailure code="${svn.exit.code}"/>
146 </condition>
147 </fail>
148 </target>
149 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
150 </target>
151</project>
Note: See TracBrowser for help on using the repository browser.