source: subversion/applications/editors/josm/plugins/addrinterpolation/build.xml @ 26174

Last change on this file since 26174 was 26174, checked in by Dirk Stoecker, 8 years ago

i18n update, split plugin and core translation

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