source: osm/applications/editors/josm/plugins/sds/build.xml@ 28191

Last change on this file since 28191 was 28160, checked in by frederik, 13 years ago

new JOSM plugin "separate data store"

File size: 6.6 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3** This is the build.xml for the SDS plugin
4**
5** Usage
6** =====
7** To build it run
8**
9** > ant dist
10**
11** To install the generated plugin locally (in your default plugin directory) run
12**
13** > ant install
14**
15** To build against the core in ../../core, create a correct manifest and deploy to
16** SVN,
17** set the properties commit.message and plugin.main.version
18** and run
19** > ant publish
20**
21**
22-->
23<project name="sds" default="dist" basedir=".">
24 <!--
25 ** update before publishing
26 -->
27 <property name="commit.message" value=""/>
28 <property name="plugin.main.version" value="4549"/>
29 <property name="josm" location="../josm/build" />
30 <property name="plugin.dist.dir" value="."/>
31 <property name="plugin.build.dir" value="build"/>
32 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
33 <property name="ant.build.javac.target" value="1.5"/>
34 <target name="init">
35 <mkdir dir="${plugin.build.dir}"/>
36 </target>
37 <target name="compile" depends="init">
38 <echo message="creating ${plugin.jar}"/>
39 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
40 <compilerarg value="-Xlint:deprecation"/>
41 <compilerarg value="-Xlint:unchecked"/>
42 </javac>
43 </target>
44 <target name="dist" depends="compile,revision">
45 <copy todir="${plugin.build.dir}/images">
46 <fileset dir="images"/>
47 </copy>
48 <copy todir="${plugin.build.dir}/data">
49 <fileset dir="data"/>
50 </copy>
51 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
52 <manifest>
53 <attribute name="Author" value="Frederik Ramm"/>
54 <attribute name="Plugin-Class" value="org.openstreetmap.hot.sds.SeparateDataStorePlugin"/>
55 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
56 <attribute name="Plugin-Description" value="Loads data from SDS" />
57 <attribute name="Plugin-Icon" value="images/sds.png"/>
58 <!--<attribute name="Plugin-Link" value=""/>-->
59 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
60 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
61 </manifest>
62 </jar>
63 </target>
64 <target name="revision">
65 <!--
66 <exec append="false" error="/dev/null" output="REVISION" executable="svn" failifexecutionfails="false">
67 <env key="LANG" value="C"/>
68 <arg value="info"/>
69 <arg value="__xml"/>
70 <arg value="."/>
71 </exec>
72 -->
73 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
74 <!--
75 <delete file="REVISION"/>
76 -->
77 </target>
78 <target name="clean">
79 <delete dir="${plugin.build.dir}"/>
80 <delete file="${plugin.jar}"/>
81 </target>
82 <target name="install" depends="dist">
83 <property environment="env"/>
84 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
85 <and>
86 <os family="windows"/>
87 </and>
88 </condition>
89 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
90 </target>
91 <!--
92 ************************** Publishing the plugin ***********************************
93 -->
94 <!--
95 ** extracts the JOSM release for the JOSM version in ../core and saves it in the
96 ** property ${coreversion.info.entry.revision}
97 **
98 -->
99 <target name="core-info">
100 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
101 <env key="LANG" value="C"/>
102 <arg value="info"/>
103 <arg value="--xml"/>
104 <arg value="../../core"/>
105 </exec>
106 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
107 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
108 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
109 <delete file="core.info.xml"/>
110 </target>
111 <!--
112 ** commits the source tree for this plugin
113 -->
114 <target name="commit-current">
115 <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
116 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
117 <env key="LANG" value="C"/>
118 <arg value="-m '${commit.message}'"/>
119 <arg value="commit"/>
120 <arg value="."/>
121 </exec>
122 </target>
123 <!--
124 ** updates (svn up) the source tree for this plugin
125 -->
126 <target name="update-current">
127 <echo>Updating plugin source ...</echo>
128 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
129 <env key="LANG" value="C"/>
130 <arg value="up"/>
131 <arg value="."/>
132 </exec>
133 <echo>Updating ${plugin.jar} ...</echo>
134 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
135 <env key="LANG" value="C"/>
136 <arg value="up"/>
137 <arg value="../dist/${plugin.jar}"/>
138 </exec>
139 </target>
140 <!--
141 ** commits the plugin.jar
142 -->
143 <target name="commit-dist">
144 <echo>
145***** Properties of published ${plugin.jar} *****
146Commit message : '${commit.message}'
147Plugin-Mainversion: ${plugin.main.version}
148JOSM build version: ${coreversion.info.entry.revision}
149Plugin-Version : ${version.entry.commit.revision}
150***** / Properties of published ${plugin.jar} *****
151
152Now commiting ${plugin.jar} ...
153</echo>
154 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
155 <env key="LANG" value="C"/>
156 <arg value="-m '${commit.message}'"/>
157 <arg value="commit"/>
158 <arg value="${plugin.jar}"/>
159 </exec>
160 </target>
161 <!-- ** make sure svn is present as a command line tool ** -->
162 <target name="ensure-svn-present">
163 <exec append="true" output="svn.log" executable="svn" failonerror="false" resultproperty="svn.exit.code">
164 <env key="LANG" value="C"/>
165 <arg value="--version"/>
166 </exec>
167 <fail message="Fatal: command 'svn' not found. Please make sure svn is installed on your system.">
168 <condition>
169 <isfailure code="${svn.exit.code}"/>
170 </condition>
171 </fail>
172 </target>
173 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
174 </target>
175</project>
Note: See TracBrowser for help on using the repository browser.