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