[23660] | 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 | ** 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="epsg31287" default="dist" basedir=".">
|
---|
| 31 |
|
---|
[23663] | 32 | <!-- read build.properties for local settings -->
|
---|
| 33 | <property file="build.properties" />
|
---|
| 34 | <!-- enter the SVN command file name -->
|
---|
| 35 | <property name="svn" value="svn.cmd" />
|
---|
[23660] | 36 | <!-- enter the SVN commit message -->
|
---|
[24044] | 37 | <property name="commit.message" value="fixed proj4 Parameters (thanks to Hetzi + Mikael Rittri)" />
|
---|
[23660] | 38 | <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
|
---|
| 39 | <property name="plugin.main.version" value="3592" />
|
---|
| 40 |
|
---|
| 41 |
|
---|
| 42 | <!--
|
---|
| 43 | ************************************************
|
---|
| 44 | ** should not be necessary to change the following properties
|
---|
| 45 | -->
|
---|
| 46 | <property name="josm" location="../../core/dist/josm-custom.jar"/>
|
---|
| 47 | <property name="plugin.build.dir" value="build"/>
|
---|
| 48 | <property name="plugin.src.dir" value="src"/>
|
---|
| 49 | <!-- this is the directory where the plugin jar is copied to -->
|
---|
| 50 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
| 51 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
| 52 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
| 53 | <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
|
---|
| 54 |
|
---|
| 55 | <!--
|
---|
| 56 | **********************************************************
|
---|
| 57 | ** init - initializes the build
|
---|
| 58 | **********************************************************
|
---|
| 59 | -->
|
---|
| 60 | <target name="init">
|
---|
| 61 | <mkdir dir="${plugin.build.dir}"/>
|
---|
| 62 | </target>
|
---|
| 63 |
|
---|
| 64 | <!--
|
---|
| 65 | **********************************************************
|
---|
| 66 | ** compile - complies the source tree
|
---|
| 67 | **********************************************************
|
---|
| 68 | -->
|
---|
| 69 | <target name="compile" depends="init">
|
---|
| 70 | <echo message="compiling sources for ${plugin.jar} ... "/>
|
---|
| 71 | <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
|
---|
| 72 | <compilerarg value="-Xlint:deprecation"/>
|
---|
| 73 | <compilerarg value="-Xlint:unchecked"/>
|
---|
| 74 | </javac>
|
---|
| 75 | </target>
|
---|
| 76 |
|
---|
| 77 | <!--
|
---|
| 78 | **********************************************************
|
---|
| 79 | ** dist - creates the plugin jar
|
---|
| 80 | **********************************************************
|
---|
| 81 | -->
|
---|
| 82 | <target name="dist" depends="compile,revision">
|
---|
| 83 | <echo message="creating ${ant.project.name}.jar ... "/>
|
---|
| 84 | <copy todir="${plugin.build.dir}/resources">
|
---|
| 85 | <fileset dir="resources"/>
|
---|
| 86 | </copy>
|
---|
| 87 | <copy todir="${plugin.build.dir}/images">
|
---|
| 88 | <fileset dir="images"/>
|
---|
| 89 | </copy>
|
---|
| 90 | <copy todir="${plugin.build.dir}">
|
---|
| 91 | <fileset dir=".">
|
---|
| 92 | <include name="README" />
|
---|
| 93 | <include name="LICENSE" />
|
---|
| 94 | </fileset>
|
---|
| 95 | </copy>
|
---|
| 96 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
---|
| 97 | <!-- <zipfileset src="lib/javaproj-1.0.6.jar" /> -->
|
---|
| 98 | <!--
|
---|
| 99 | ************************************************
|
---|
| 100 | ** configure these properties. Most of them will be copied to the plugins
|
---|
| 101 | ** manifest file. Property values will also show up in the list available
|
---|
| 102 | ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
|
---|
| 103 | **
|
---|
| 104 | ************************************************
|
---|
| 105 | -->
|
---|
| 106 | <manifest>
|
---|
[23670] | 107 | <attribute name="Author" value="Fichtennadel"/>
|
---|
[23660] | 108 | <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.epsg31287.Epsg31287"/>
|
---|
| 109 | <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
|
---|
[23670] | 110 | <attribute name="Plugin-Description" value="sets current projection to EPSG:31287 - Bessel 1841 in Lambert Conformal Conic. For use with WMS plugin to load geoimage.at WMS, see link for details"/>
|
---|
| 111 | <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/epsg31287"/>
|
---|
[23660] | 112 | <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
|
---|
[23662] | 113 | <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
|
---|
[23661] | 114 | <!-- <attribute name="Plugin-Version" value="0.3"/> -->
|
---|
[23660] | 115 | </manifest>
|
---|
| 116 | </jar>
|
---|
| 117 | </target>
|
---|
| 118 |
|
---|
| 119 | <!--
|
---|
| 120 | **********************************************************
|
---|
| 121 | ** revision - extracts the current revision number for the
|
---|
| 122 | ** file build.number and stores it in the XML property
|
---|
| 123 | ** version.*
|
---|
| 124 | **********************************************************
|
---|
| 125 | -->
|
---|
| 126 | <target name="revision">
|
---|
| 127 |
|
---|
[23663] | 128 | <exec append="false" output="REVISION" executable="${svn}" failifexecutionfails="false">
|
---|
[23660] | 129 | <env key="LANG" value="C"/>
|
---|
| 130 | <arg value="info"/>
|
---|
| 131 | <arg value="--xml"/>
|
---|
| 132 | <arg value="."/>
|
---|
| 133 | </exec>
|
---|
| 134 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
| 135 | <delete file="REVISION"/>
|
---|
| 136 | </target>
|
---|
| 137 |
|
---|
| 138 | <!--
|
---|
| 139 | **********************************************************
|
---|
| 140 | ** clean - clean up the build environment
|
---|
| 141 | **********************************************************
|
---|
| 142 | -->
|
---|
| 143 | <target name="clean">
|
---|
| 144 | <delete dir="${plugin.build.dir}"/>
|
---|
| 145 | <delete file="${plugin.jar}"/>
|
---|
| 146 | </target>
|
---|
| 147 |
|
---|
| 148 | <!--
|
---|
| 149 | **********************************************************
|
---|
| 150 | ** install - install the plugin in your local JOSM installation
|
---|
| 151 | **********************************************************
|
---|
| 152 | -->
|
---|
| 153 | <target name="install" depends="dist">
|
---|
| 154 | <property environment="env"/>
|
---|
| 155 | <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
|
---|
| 156 | <and>
|
---|
| 157 | <os family="windows"/>
|
---|
| 158 | </and>
|
---|
| 159 | </condition>
|
---|
| 160 | <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
|
---|
| 161 | </target>
|
---|
| 162 |
|
---|
| 163 |
|
---|
| 164 | <!--
|
---|
| 165 | ************************** Publishing the plugin ***********************************
|
---|
| 166 | -->
|
---|
| 167 | <!--
|
---|
| 168 | ** extracts the JOSM release for the JOSM version in ../core and saves it in the
|
---|
| 169 | ** property ${coreversion.info.entry.revision}
|
---|
| 170 | **
|
---|
| 171 | -->
|
---|
| 172 | <target name="core-info">
|
---|
[23663] | 173 | <exec append="false" output="core.info.xml" executable="${svn}" failifexecutionfails="false">
|
---|
[23660] | 174 | <env key="LANG" value="C"/>
|
---|
| 175 | <arg value="info"/>
|
---|
| 176 | <arg value="--xml"/>
|
---|
| 177 | <arg value="../../core"/>
|
---|
| 178 | </exec>
|
---|
| 179 | <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
|
---|
| 180 | <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
|
---|
| 181 | <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
|
---|
| 182 | <delete file="core.info.xml" />
|
---|
| 183 | </target>
|
---|
| 184 |
|
---|
| 185 | <!--
|
---|
| 186 | ** commits the source tree for this plugin
|
---|
| 187 | -->
|
---|
| 188 | <target name="commit-current">
|
---|
| 189 | <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
|
---|
[23663] | 190 | <exec append="true" output="svn.log" executable="${svn}" failifexecutionfails="false">
|
---|
[23660] | 191 | <env key="LANG" value="C"/>
|
---|
| 192 | <arg value="commit"/>
|
---|
| 193 | <arg value="-m '${commit.message}'"/>
|
---|
| 194 | <arg value="."/>
|
---|
[23663] | 195 | <arg value="${svn.username_arg}"/>
|
---|
| 196 | <arg value="${svn.username}"/>
|
---|
| 197 | <arg value="${svn.password_arg}"/>
|
---|
| 198 | <arg value="${svn.password}"/>
|
---|
[23660] | 199 | </exec>
|
---|
| 200 | </target>
|
---|
| 201 |
|
---|
| 202 | <!--
|
---|
| 203 | ** updates (svn up) the source tree for this plugin
|
---|
| 204 | -->
|
---|
| 205 | <target name="update-current">
|
---|
| 206 | <echo>Updating plugin source ...</echo>
|
---|
[23663] | 207 | <exec append="true" output="svn.log" executable="${svn}" failifexecutionfails="false">
|
---|
[23660] | 208 | <env key="LANG" value="C"/>
|
---|
| 209 | <arg value="up"/>
|
---|
| 210 | <arg value="."/>
|
---|
| 211 | </exec>
|
---|
| 212 | <echo>Updating ${plugin.jar} ...</echo>
|
---|
[23663] | 213 | <exec append="true" output="svn.log" executable="${svn}" failifexecutionfails="false">
|
---|
[23660] | 214 | <env key="LANG" value="C"/>
|
---|
| 215 | <arg value="up"/>
|
---|
| 216 | <arg value="../dist/${plugin.jar}"/>
|
---|
| 217 | </exec>
|
---|
| 218 | </target>
|
---|
| 219 |
|
---|
| 220 | <!--
|
---|
| 221 | ** commits the plugin.jar
|
---|
| 222 | -->
|
---|
| 223 | <target name="commit-dist">
|
---|
| 224 | <echo>
|
---|
| 225 | ***** Properties of published ${plugin.jar} *****
|
---|
| 226 | Commit message : '${commit.message}'
|
---|
| 227 | Plugin-Mainversion: ${plugin.main.version}
|
---|
| 228 | JOSM build version: ${coreversion.info.entry.revision}
|
---|
| 229 | Plugin-Version : ${version.entry.commit.revision}
|
---|
| 230 | ***** / Properties of published ${plugin.jar} *****
|
---|
| 231 |
|
---|
| 232 | Now commiting ${plugin.jar} ...
|
---|
| 233 | </echo>
|
---|
[23663] | 234 | <exec append="true" output="svn.log" executable="${svn}" failifexecutionfails="false">
|
---|
[23660] | 235 | <env key="LANG" value="C"/>
|
---|
| 236 | <arg value="-m '${commit.message}'"/>
|
---|
| 237 | <arg value="commit"/>
|
---|
| 238 | <arg value="${plugin.jar}"/>
|
---|
[23663] | 239 | <arg value="${svn.username_arg}"/>
|
---|
| 240 | <arg value="${svn.username}"/>
|
---|
| 241 | <arg value="${svn.password_arg}"/>
|
---|
| 242 | <arg value="${svn.password}"/>
|
---|
[23660] | 243 | </exec>
|
---|
| 244 | </target>
|
---|
| 245 |
|
---|
| 246 | <!-- ** make sure svn is present as a command line tool ** -->
|
---|
| 247 | <target name="ensure-svn-present">
|
---|
[23663] | 248 | <exec append="true" output="svn.log" executable="${svn}" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
|
---|
[23660] | 249 | <env key="LANG" value="C" />
|
---|
| 250 | <arg value="--version" />
|
---|
| 251 | </exec>
|
---|
| 252 | <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
|
---|
| 253 | <!-- return code not set at all? Most likely svn isn't installed -->
|
---|
| 254 | <condition>
|
---|
| 255 | <not>
|
---|
| 256 | <isset property="svn.exit.code" />
|
---|
| 257 | </not>
|
---|
| 258 | </condition>
|
---|
| 259 | </fail>
|
---|
| 260 | <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
|
---|
| 261 | <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
|
---|
| 262 | <condition>
|
---|
| 263 | <isfailure code="${svn.exit.code}" />
|
---|
| 264 | </condition>
|
---|
| 265 | </fail>
|
---|
| 266 | </target>
|
---|
| 267 |
|
---|
| 268 | <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
|
---|
| 269 | </target>
|
---|
| 270 | </project>
|
---|