source: subversion/applications/editors/josm/plugins/globalsat/build.xml @ 29435

Last change on this file since 29435 was 29435, checked in by Dirk Stoecker, 7 years ago

i18n update

  • Property svn:mime-type set to text/xml
File size: 8.1 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3** This is the build file for the globalsat  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="globalsat" default="dist" basedir=".">
31    <!-- enter the SVN commit message -->
32    <property name="commit.message" value="Changed constructor signature of plugin main class"/>
33    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
34    <property name="plugin.main.version" value="5681"/>
35    <!--
36      ************************************************
37      ** should not be necessary to change the following properties
38     -->
39    <property name="josm" location="../../core/dist/josm-custom.jar"/>
40    <property name="plugin.dist.dir" value="../../dist"/>
41    <property name="plugin.build.dir" value="build"/>
42    <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
43    <property name="ant.build.javac.target" value="1.5"/>
44    <property name="RXTX" location="./libs/RXTXcomm.jar"/>
45    <target name="init">
46        <mkdir dir="${plugin.build.dir}"/>
47    </target>
48    <target name="compile" depends="init">
49        <echo message="creating ${plugin.jar}"/>
50        <javac srcdir="src" debug="true" destdir="${plugin.build.dir}">
51            <compilerarg value="-Xlint:deprecation"/>
52            <compilerarg value="-Xlint:unchecked"/>
53            <classpath>
54                <pathelement location="${josm}"/>
55                <pathelement location="${RXTX}"/>
56            </classpath>
57        </javac>
58    </target>
59    <target name="dist" depends="compile,revision">
60        <unjar dest="${plugin.build.dir}" src="${RXTX}"/>
61        <copy todir="${plugin.build.dir}/images">
62            <fileset dir="images"/>
63        </copy>
64        <copy todir="${plugin.build.dir}/data">
65            <fileset dir="data"/>
66        </copy>
67        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
68            <manifest>
69                <attribute name="Author" value="Raphael Mack"/>
70                <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.globalsat.GlobalsatPlugin"/>
71                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
72                <attribute name="Plugin-Description" value="Download GPS points from Globalsat dg100 data logger directly in JOSM."/>
73                <attribute name="Plugin-Icon" value="images/globalsatImport.png"/>
74                <attribute name="Plugin-Link" value="http://www.raphael-mack.de/josm-globalsat-gpx-import-plugin/"/>
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        ************************** Publishing the plugin ***********************************
105        -->
106    <!--
107            ** extracts the JOSM release for the JOSM version in ../core and saves it in the
108            ** property ${coreversion.info.entry.revision}
109            **
110            -->
111    <target name="core-info">
112        <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
113            <env key="LANG" value="C"/>
114            <arg value="info"/>
115            <arg value="--xml"/>
116            <arg value="../../core"/>
117        </exec>
118        <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
119        <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
120        <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
121        <delete file="core.info.xml"/>
122    </target>
123    <!--
124            ** commits the source tree for this plugin
125            -->
126    <target name="commit-current">
127        <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
128        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
129            <env key="LANG" value="C"/>
130            <arg value="commit"/>
131            <arg value="-m '${commit.message}'"/>
132            <arg value="."/>
133        </exec>
134    </target>
135    <!--
136            ** updates (svn up) the source tree for this plugin
137            -->
138    <target name="update-current">
139        <echo>Updating plugin source ...</echo>
140        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
141            <env key="LANG" value="C"/>
142            <arg value="up"/>
143            <arg value="."/>
144        </exec>
145        <echo>Updating ${plugin.jar} ...</echo>
146        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
147            <env key="LANG" value="C"/>
148            <arg value="up"/>
149            <arg value="../dist/${plugin.jar}"/>
150        </exec>
151    </target>
152    <!--
153            ** commits the plugin.jar
154            -->
155    <target name="commit-dist">
156        <echo>
157        ***** Properties of published ${plugin.jar} *****
158        Commit message    : '${commit.message}'
159        Plugin-Mainversion: ${plugin.main.version}
160        JOSM build version: ${coreversion.info.entry.revision}
161        Plugin-Version    : ${version.entry.commit.revision}
162        ***** / Properties of published ${plugin.jar} *****
163
164        Now commiting ${plugin.jar} ...
165        </echo>
166        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
167            <env key="LANG" value="C"/>
168            <arg value="-m '${commit.message}'"/>
169            <arg value="commit"/>
170            <arg value="${plugin.jar}"/>
171        </exec>
172    </target>
173    <!-- ** make sure svn is present as a command line tool ** -->
174    <target name="ensure-svn-present">
175        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
176            <env key="LANG" value="C"/>
177            <arg value="--version"/>
178        </exec>
179        <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
180            <!-- return code not set at all? Most likely svn isn't installed -->
181            <condition>
182                <not>
183                    <isset property="svn.exit.code"/>
184                </not>
185            </condition>
186        </fail>
187        <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
188            <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
189            <condition>
190                <isfailure code="${svn.exit.code}"/>
191            </condition>
192        </fail>
193    </target>
194    <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
195    </target>
196</project>
Note: See TracBrowser for help on using the repository browser.