source: osm/applications/editors/josm/plugins/openlayers/build.xml@ 23145

Last change on this file since 23145 was 22550, checked in by jttt, 14 years ago

Adapt to latest josm

File size: 6.8 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3** This is the build file for the openlayers 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="openlayers" default="dist" basedir=".">
31
32 <!-- enter the SVN commit message -->
33 <property name="commit.message" value="Changed the constructor signature of the plugin main class" />
34 <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
35 <property name="plugin.main.version" value="3408" />
36
37 <property name="josm" location="../../core/dist/josm-custom.jar"/>
38 <property name="plugin.dist.dir" value="../../dist"/>
39 <property name="plugin.build.dir" value="build"/>
40 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
41 <property name="ant.build.javac.target" value="1.5"/>
42 <target name="init">
43 <mkdir dir="${plugin.build.dir}"/>
44 </target>
45 <target name="compile" depends="init">
46 <echo message="creating ${plugin.jar}"/>
47 <javac srcdir="src" debug="true" destdir="${plugin.build.dir}">
48 <compilerarg value="-Xlint:deprecation"/>
49 <compilerarg value="-Xlint:unchecked"/>
50 <classpath>
51 <pathelement location="${josm}"/>
52 <fileset dir="lib">
53 <include name="**/*.jar"/>
54 </fileset>
55 </classpath>
56 </javac>
57 </target>
58 <target name="dist" depends="compile,revision">
59 <unjar dest="${plugin.build.dir}">
60 <fileset dir="lib"/>
61 </unjar>
62 <copy todir="${plugin.build.dir}/resources">
63 <fileset dir="resources"/>
64 </copy>
65 <copy todir="${plugin.build.dir}/images">
66 <fileset dir="images"/>
67 </copy>
68 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
69 <manifest>
70 <attribute name="Author" value="Francisco R. Santos" />
71 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.openLayers.OpenLayersPlugin" />
72 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
73 <attribute name="Plugin-Description" value="Displays an OpenLayers background image" />
74 <attribute name="Plugin-Icon" value="images/OpenLayers.png"/>
75 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
76 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
77 </manifest>
78 </jar>
79 </target>
80 <target name="revision">
81 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
82 <env key="LANG" value="C"/>
83 <arg value="info"/>
84 <arg value="--xml"/>
85 <arg value="."/>
86 </exec>
87 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
88 <delete file="REVISION"/>
89 </target>
90 <target name="clean">
91 <delete dir="${plugin.build.dir}"/>
92 <delete file="${plugin.jar}"/>
93 </target>
94 <target name="install" depends="dist">
95 <property environment="env"/>
96 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
97 <and>
98 <os family="windows"/>
99 </and>
100 </condition>
101 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
102 </target>
103
104 <!--
105 ************************** Publishing the plugin ***********************************
106 -->
107 <!--
108 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
109 ** property ${coreversion.info.entry.revision}
110 **
111 -->
112 <target name="core-info">
113 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
114 <env key="LANG" value="C"/>
115 <arg value="info"/>
116 <arg value="--xml"/>
117 <arg value="../../core"/>
118 </exec>
119 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
120 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
121 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
122 <delete file="core.info.xml" />
123 </target>
124
125 <!--
126 ** commits the source tree for this plugin
127 -->
128 <target name="commit-current">
129 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
130 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
131 <env key="LANG" value="C"/>
132 <arg value="commit"/>
133 <arg value="-m '${commit.message}'"/>
134 <arg value="."/>
135 </exec>
136 </target>
137
138 <!--
139 ** updates (svn up) the source tree for this plugin
140 -->
141 <target name="update-current">
142 <echo>Updating plugin source ...</echo>
143 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
144 <env key="LANG" value="C"/>
145 <arg value="up"/>
146 <arg value="."/>
147 </exec>
148 <echo>Updating ${plugin.jar} ...</echo>
149 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
150 <env key="LANG" value="C"/>
151 <arg value="up"/>
152 <arg value="../dist/${plugin.jar}"/>
153 </exec>
154 </target>
155
156 <!--
157 ** commits the plugin.jar
158 -->
159 <target name="commit-dist">
160 <echo>
161 ***** Properties of published ${plugin.jar} *****
162 Commit message : '${commit.message}'
163 Plugin-Mainversion: ${plugin.main.version}
164 JOSM build version: ${coreversion.info.entry.revision}
165 Plugin-Version : ${version.entry.commit.revision}
166 ***** / Properties of published ${plugin.jar} *****
167
168 Now commiting ${plugin.jar} ...
169 </echo>
170 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
171 <env key="LANG" value="C"/>
172 <arg value="-m '${commit.message}'"/>
173 <arg value="commit"/>
174 <arg value="${plugin.jar}"/>
175 </exec>
176 </target>
177
178 <!-- ** make sure svn is present as a command line tool ** -->
179 <target name="ensure-svn-present">
180 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
181 <env key="LANG" value="C" />
182 <arg value="--version" />
183 </exec>
184 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
185 <!-- return code not set at all? Most likely svn isn't installed -->
186 <condition>
187 <not>
188 <isset property="svn.exit.code" />
189 </not>
190 </condition>
191 </fail>
192 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
193 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
194 <condition>
195 <isfailure code="${svn.exit.code}" />
196 </condition>
197 </fail>
198 </target>
199
200 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
201 </target>
202</project>
Note: See TracBrowser for help on using the repository browser.