source: osm/applications/editors/josm/plugins/smed/build.xml@ 29423

Last change on this file since 29423 was 29423, checked in by malcolmh, 12 years ago

all primitives

File size: 9.6 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3***** Please do not update this file!!!! *****
4** It is an 'oddball' build, therefore the standard template will not work **
5-->
6<project name="SeaMapEditor" basedir=".">
7 <!-- enter the SVN commit message -->
8 <property name="commit.message" value="New release"/>
9 <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
10 <property name="plugin.main.version" value="4394"/>
11 <!-- should not be necessary to change the following properties -->
12 <property name="josm" location="../../core/dist/josm-custom.jar"/>
13 <property name="plugin.build.dir" value="build/"/>
14 <property name="plugin.src.dir" value="src/"/>
15 <property name="smed.dist.dir" value="dist/"/>
16 <!-- this is the directory where the plugin jar is copied to -->
17 <property name="plugin.dist.dir" value="../../dist/"/>
18 <property name="smed_core.dist.dir" value="core/dist/"/>
19 <property name="ant.build.javac.target" value="1.5"/>
20 <property name="plugin.jar" value="${plugin.dist.dir}${ant.project.name}.jar"/>
21 <!--
22 **********************************************************
23 ** init - initializes the build
24 **********************************************************
25 -->
26 <target name="init">
27 <mkdir dir="${plugin.build.dir}"/>
28 <mkdir dir="${smed_core.dist.dir}"/>
29 <mkdir dir="${smed.dist.dir}"/>
30 </target>
31 <!--
32 **********************************************************
33 ** compile - complies the source tree
34 **********************************************************
35 -->
36 <target name="compile" depends="init">
37 <echo message="compiling sources for ${plugin.jar} ... "/>
38 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
39 <compilerarg value="-Xlint:deprecation"/>
40 <compilerarg value="-Xlint:unchecked"/>
41 </javac>
42 </target>
43 <!--
44 **********************************************************
45 ** dist - creates the plugin jar
46 **********************************************************
47 -->
48 <target name="dist" depends="compile, revision">
49 <echo message="creating ${ant.project.name}.jar ... "/>
50 <copy todir="${plugin.build.dir}/images">
51 <fileset dir="images"/>
52 </copy>
53 <copy todir="${plugin.build.dir}/data">
54 <fileset dir="data"/>
55 </copy>
56 <copy todir="${plugin.build.dir}/smed/msg">
57 <fileset dir="${plugin.src.dir}/smed/msg"/>
58 </copy>
59 <copy todir="${plugin.build.dir}">
60 <fileset dir="${smed.dist.dir}"/>
61 </copy>
62 <copy todir="${plugin.build.dir}">
63 <fileset dir=".">
64 <include name="*.txt"/>
65 </fileset>
66 </copy>
67 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
68 <!--
69 ************************************************
70 ** configure these properties. Most of them will be copied to the plugins
71 ** manifest file. Property values will also show up in the list available
72 ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
73 **
74 ************************************************
75 -->
76 <manifest>
77 <attribute name="Author" value="Werner, Malcolm"/>
78 <attribute name="Plugin-Class" value="smed.Smed"/>
79 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
80 <attribute name="Plugin-Description" value="Create and edit seamaps for OpenSeaMap"/>
81 <attribute name="Plugin-Icon" value="images/Smed.png"/>
82 <attribute name="Plugin-Link" value="http://openseamap.org/"/>
83 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
84 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
85 </manifest>
86 </jar>
87 <!-- install interface -->
88 <copy file="${plugin.jar}" todir="${smed_core.dist.dir}"/>
89 </target>
90 <!--
91 **********************************************************
92 ** revision - extracts the current revision number for the
93 ** file build.number and stores it in the XML property
94 ** version.*
95 **********************************************************
96 -->
97 <target name="revision">
98 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
99 <env key="LANG" value="C"/>
100 <arg value="info"/>
101 <arg value="--xml"/>
102 <arg value="."/>
103 </exec>
104 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
105 <delete file="REVISION"/>
106 </target>
107 <!--
108 **********************************************************
109 ** clean - clean up the build environment
110 **********************************************************
111 -->
112 <target name="clean">
113 <delete dir="${plugin.build.dir}"/>
114 <delete dir="${smed_core.dist.dir}"/>
115 <delete dir="${smed.dist.dir}"/>
116 <delete file="${plugin.jar}"/>
117 </target>
118 <!--
119 **********************************************************
120 ** install - install the plugin in your local JOSM installation
121 **********************************************************
122 -->
123 <target name="install" depends="dist">
124 <property environment="env"/>
125 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
126 <and>
127 <os family="windows"/>
128 </and>
129 </condition>
130 <delete dir="${josm.plugins.dir}/splug"/>
131 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
132 </target>
133 <!--
134 ************************** Publishing the plugin ***********************************
135 -->
136 <!--
137 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
138 ** property ${coreversion.info.entry.revision}
139 -->
140 <target name="core-info">
141 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
142 <env key="LANG" value="C"/>
143 <arg value="info"/>
144 <arg value="--xml"/>
145 <arg value="../../core"/>
146 </exec>
147 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
148 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
149 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
150 <delete file="core.info.xml"/>
151 </target>
152 <!-- commits the source tree for this plugin -->
153 <target name="commit-current">
154 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
155 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
156 <env key="LANG" value="C"/>
157 <arg value="commit"/>
158 <arg value="-m '${commit.message}'"/>
159 <arg value="."/>
160 </exec>
161 </target>
162 <!-- updates (svn up) the source tree for this plugin -->
163 <target name="update-current">
164 <echo>Updating plugin source ...</echo>
165 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
166 <env key="LANG" value="C"/>
167 <arg value="up"/>
168 <arg value="."/>
169 </exec>
170 <echo>Updating ${plugin.jar} ...</echo>
171 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
172 <env key="LANG" value="C"/>
173 <arg value="up"/>
174 <arg value="../dist/${plugin.jar}"/>
175 </exec>
176 </target>
177 <!-- commits the plugin.jar -->
178 <target name="commit-dist">
179 <echo>
180 ***** Properties of published ${plugin.jar} *****
181 Commit message : '${commit.message}'
182 Plugin-Mainversion: ${plugin.main.version}
183 JOSM build version: ${coreversion.info.entry.revision}
184 Plugin-Version : ${version.entry.commit.revision}
185 ***** / Properties of published ${plugin.jar} *****
186
187 Now commiting ${plugin.jar} ...
188 </echo>
189 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
190 <env key="LANG" value="C"/>
191 <arg value="-m '${commit.message}'"/>
192 <arg value="commit"/>
193 <arg value="${plugin.jar}"/>
194 </exec>
195 </target>
196 <!-- make sure svn is present as a command line tool -->
197 <target name="ensure-svn-present">
198 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
199 <env key="LANG" value="C"/>
200 <arg value="--version"/>
201 </exec>
202 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
203 <!-- return code not set at all? Most likely svn isn't installed -->
204 <condition>
205 <not>
206 <isset property="svn.exit.code"/>
207 </not>
208 </condition>
209 </fail>
210 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
211 <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
212 <condition>
213 <isfailure code="${svn.exit.code}"/>
214 </condition>
215 </fail>
216 </target>
217 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
218 </target>
219</project>
Note: See TracBrowser for help on using the repository browser.