source: osm/applications/editors/josm/plugins/piclayer/build.xml@ 24288

Last change on this file since 24288 was 24288, checked in by ocroquette, 14 years ago

Precision of rotation and scaling is now increased when pressing the SHIFT key

File size: 8.0 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-->
23<project name="PicLayer" default="dist" basedir=".">
24
25 <property name="commit.message" value="Changed the constructor signature of the plugin main class" />
26 <property name="plugin.main.version" value="3408" />
27
28 <!--
29 ************************************************
30 ** should not be necessary to change the following properties
31 -->
32 <property name="josm" location="../../core/dist/josm-custom.jar"/>
33 <property name="plugin.build.dir" value="build"/>
34 <property name="plugin.src.dir" value="src"/>
35 <!-- this is the directory where the plugin jar is copied to -->
36 <property name="plugin.dist.dir" value="../../dist"/>
37 <property name="ant.build.javac.target" value="1.5"/>
38 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
39
40 <!--
41 **********************************************************
42 ** init - initializes the build
43 **********************************************************
44 -->
45 <target name="init">
46 <mkdir dir="${plugin.build.dir}"/>
47 </target>
48
49 <!--
50 **********************************************************
51 ** compile - complies the source tree
52 **********************************************************
53 -->
54 <target name="compile" depends="init">
55 <echo message="compiling sources for ${ant.project.name} ... "/>
56 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
57 <compilerarg value="-Xlint:deprecation"/>
58 <compilerarg value="-Xlint:unchecked"/>
59 </javac>
60 </target>
61
62 <!--
63 **********************************************************
64 ** dist - creates the plugin jar
65 **********************************************************
66 -->
67 <target name="dist" depends="compile,revision">
68 <echo message="creating ${plugin.jar} ... "/>
69 <copy todir="${plugin.build.dir}/resources">
70 <fileset dir="resources"/>
71 </copy>
72 <copy todir="${plugin.build.dir}/images">
73 <fileset dir="images"/>
74 </copy>
75 <copy todir="${plugin.build.dir}">
76 <fileset dir=".">
77 <include name="README" />
78 <include name="LICENSE" />
79 </fileset>
80 </copy>
81 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
82 <manifest>
83 <attribute name="Author" value="Tomasz Stelmach"/>
84 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.piclayer.PicLayerPlugin"/>
85 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
86 <attribute name="Plugin-Description" value="This plugin allows to display any picture as a background in the editor and align it with the map."/>
87 <attribute name="Plugin-Icon" value="images/layericon.png"/>
88 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
89 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
90 </manifest>
91 </jar>
92 </target>
93
94 <!--
95 **********************************************************
96 ** revision - extracts the current revision number for the
97 ** file build.number and stores it in the XML property
98 ** version.*
99 **********************************************************
100 -->
101 <target name="revision">
102 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
103 </target>
104
105 <!--
106 **********************************************************
107 ** clean - clean up the build environment
108 **********************************************************
109 -->
110 <target name="clean">
111 <delete dir="${plugin.build.dir}"/>
112 <delete file="${plugin.jar}"/>
113 </target>
114
115 <!--
116 **********************************************************
117 ** install - install the plugin in your local JOSM installation
118 **********************************************************
119 -->
120 <target name="install" depends="dist">
121 <property environment="env"/>
122 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
123 <and>
124 <os family="windows"/>
125 </and>
126 </condition>
127 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
128 </target>
129
130 <!--
131 ************************** Publishing the plugin ***********************************
132 -->
133 <!--
134 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
135 ** property ${coreversion.info.entry.revision}
136 **
137 -->
138 <target name="core-info">
139 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
140 <env key="LANG" value="C"/>
141 <arg value="info"/>
142 <arg value="--xml"/>
143 <arg value="../../core"/>
144 </exec>
145 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
146 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
147 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
148 <delete file="core.info.xml" />
149 </target>
150
151 <!--
152 ** commits the source tree for this plugin
153 -->
154 <target name="commit-current">
155 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
156 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
157 <env key="LANG" value="C"/>
158 <arg value="commit"/>
159 <arg value="-m '${commit.message}'"/>
160 <arg value="."/>
161 </exec>
162 </target>
163
164 <!--
165 ** updates (svn up) the source tree for this plugin
166 -->
167 <target name="update-current">
168 <echo>Updating plugin source ...</echo>
169 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
170 <env key="LANG" value="C"/>
171 <arg value="up"/>
172 <arg value="."/>
173 </exec>
174 <echo>Updating ${plugin.jar} ...</echo>
175 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
176 <env key="LANG" value="C"/>
177 <arg value="up"/>
178 <arg value="../dist/${plugin.jar}"/>
179 </exec>
180 </target>
181
182 <!--
183 ** commits the plugin.jar
184 -->
185 <target name="commit-dist">
186 <echo>
187 ***** Properties of published ${plugin.jar} *****
188 Commit message : '${commit.message}'
189 Plugin-Mainversion: ${plugin.main.version}
190 JOSM build version: ${coreversion.info.entry.revision}
191 Plugin-Version : ${version.entry.commit.revision}
192 ***** / Properties of published ${plugin.jar} *****
193
194 Now commiting ${plugin.jar} ...
195 </echo>
196 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
197 <env key="LANG" value="C"/>
198 <arg value="-m '${commit.message}'"/>
199 <arg value="commit"/>
200 <arg value="${plugin.jar}"/>
201 </exec>
202 </target>
203
204 <!-- ** make sure svn is present as a command line tool ** -->
205 <target name="ensure-svn-present">
206 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
207 <env key="LANG" value="C" />
208 <arg value="--version" />
209 </exec>
210 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
211 <!-- return code not set at all? Most likely svn isn't installed -->
212 <condition>
213 <not>
214 <isset property="svn.exit.code" />
215 </not>
216 </condition>
217 </fail>
218 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
219 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
220 <condition>
221 <isfailure code="${svn.exit.code}" />
222 </condition>
223 </fail>
224 </target>
225
226 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
227 </target>
228</project>
Note: See TracBrowser for help on using the repository browser.