source: osm/applications/editors/josm/plugins/touchscreenhelper/build.xml@ 21569

Last change on this file since 21569 was 21569, checked in by glebius, 15 years ago

Add touchscreenhelper plugin.

File size: 6.5 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3** This is a template build file for a JOSM plugin.
4**
5** Maintaining versions
6** ====================
7** see README.template
8**
9** Usage
10** =====
11** To build it run
12**
13** > ant dist
14**
15** To install the generated plugin locally (in you default plugin directory) run
16**
17** > ant install
18**
19** The generated plugin jar is not automatically available in JOSMs plugin configuration
20** dialog. You have to check it in first.
21**
22** Use the ant target 'publish' to check in the plugin and make it available to other
23** JOSM users:
24** set the properties commit.message and plugin.main.version
25** and run
26** > ant publish
27**
28**
29-->
30<project name="touchscreenhelper" default="dist" basedir=".">
31 <!-- enter the SVN commit message -->
32 <property name="commit.message" value="Commit message" />
33 <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
34 <property name="plugin.main.version" value="3208" />
35
36 <property name="josm" location="../../dist/josm-custom.jar"/>
37 <property name="plugin.build.dir" value="build"/>
38 <property name="plugin.src.dir" value="src"/>
39 <property name="plugin.dist.dir" value="../../dist"/>
40 <property name="ant.build.javac.target" value="1.5"/>
41 <property name="plugin.dist.dir" value="../../dist"/>
42 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
43
44 <target name="init">
45 <mkdir dir="${plugin.build.dir}"/>
46 </target>
47
48 <target name="compile" depends="init">
49 <echo message="compiling sources for ${plugin.jar} ... "/>
50 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
51 <compilerarg value="-Xlint:deprecation"/>
52 <compilerarg value="-Xlint:unchecked"/>
53 </javac>
54 </target>
55
56 <target name="dist" depends="compile,revision">
57 <echo message="creating ${ant.project.name}.jar ... "/>
58 <copy todir="${plugin.build.dir}/resources">
59 <fileset dir="resources"/>
60 </copy>
61 <copy todir="${plugin.build.dir}/images">
62 <fileset dir="images"/>
63 </copy>
64 <copy todir="${plugin.build.dir}">
65 <fileset dir=".">
66 <include name="README" />
67 <include name="LICENSE" />
68 </fileset>
69 </copy>
70 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
71 <manifest>
72 <attribute name="Author" value="glebius@glebius.int.ru"/>
73 <attribute name="Plugin-Class" value="touchscreenhelper.TouchScreenHelperPlugin"/>
74 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
75 <attribute name="Plugin-Description" value="Provides helper buttons to allow working with single button mouse (stylus). Currently adds only one button to slip the map."/>
76 <attribute name="Plugin-Link" value="..."/>
77 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
78 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
79 </manifest>
80 </jar>
81 </target>
82
83 <target name="revision">
84
85 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
86 <env key="LANG" value="C"/>
87 <arg value="info"/>
88 <arg value="--xml"/>
89 <arg value="."/>
90 </exec>
91 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
92 <delete file="REVISION"/>
93 </target>
94
95 <target name="clean">
96 <delete dir="${plugin.build.dir}"/>
97 <delete file="${plugin.jar}"/>
98 </target>
99
100 <target name="install" depends="dist">
101 <property environment="env"/>
102 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
103 <and>
104 <os family="windows"/>
105 </and>
106 </condition>
107 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
108 </target>
109
110
111 <target name="core-info">
112 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
113 <env key="LANG" value="C"/>
114 <arg value="info"/>
115 <arg value="--xml"/>
116 <arg value="../../core"/>
117 </exec>
118 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
119 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
120 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
121 <delete file="core.info.xml" />
122 </target>
123
124 <target name="commit-current">
125 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
126 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
127 <env key="LANG" value="C"/>
128 <arg value="commit"/>
129 <arg value="-m '${commit.message}'"/>
130 <arg value="."/>
131 </exec>
132 </target>
133
134 <target name="update-current">
135 <echo>Updating plugin source ...</echo>
136 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
137 <env key="LANG" value="C"/>
138 <arg value="up"/>
139 <arg value="."/>
140 </exec>
141 <echo>Updating ${plugin.jar} ...</echo>
142 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
143 <env key="LANG" value="C"/>
144 <arg value="up"/>
145 <arg value="../dist/${plugin.jar}"/>
146 </exec>
147 </target>
148
149 <target name="commit-dist">
150 <echo>
151 ***** Properties of published ${plugin.jar} *****
152 Commit message : '${commit.message}'
153 Plugin-Mainversion: ${plugin.main.version}
154 JOSM build version: ${coreversion.info.entry.revision}
155 Plugin-Version : ${version.entry.commit.revision}
156 ***** / Properties of published ${plugin.jar} *****
157
158 Now commiting ${plugin.jar} ...
159 </echo>
160 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
161 <env key="LANG" value="C"/>
162 <arg value="-m '${commit.message}'"/>
163 <arg value="commit"/>
164 <arg value="${plugin.jar}"/>
165 </exec>
166 </target>
167
168 <target name="ensure-svn-present">
169 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
170 <env key="LANG" value="C" />
171 <arg value="--version" />
172 </exec>
173 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
174 <!-- return code not set at all? Most likely svn isn't installed -->
175 <condition>
176 <not>
177 <isset property="svn.exit.code" />
178 </not>
179 </condition>
180 </fail>
181 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
182 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
183 <condition>
184 <isfailure code="${svn.exit.code}" />
185 </condition>
186 </fail>
187 </target>
188
189 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
190 </target>
191</project>
Note: See TracBrowser for help on using the repository browser.