[14334] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[14429] | 2 | <!--
|
---|
[18955] | 3 | ** This is the build file for the tageditor plugin
|
---|
[14429] | 4 | **
|
---|
| 5 | ** Maintaining versions
|
---|
| 6 | ** ====================
|
---|
[14837] | 7 | ** see README.template
|
---|
[14429] | 8 | **
|
---|
| 9 | ** Usage
|
---|
| 10 | ** =====
|
---|
| 11 | ** To build it run
|
---|
[14837] | 12 | **
|
---|
[14429] | 13 | ** > ant dist
|
---|
| 14 | **
|
---|
[16851] | 15 | ** To install the generated plugin locally (in your default plugin directory) run
|
---|
[14837] | 16 | **
|
---|
[14429] | 17 | ** > ant install
|
---|
[14837] | 18 | **
|
---|
[16851] | 19 | ** To build against the core in ../../core, create a correct manifest and deploy to
|
---|
[18488] | 20 | ** SVN,
|
---|
| 21 | ** set the properties commit.message and plugin.main.version
|
---|
| 22 | ** and run
|
---|
| 23 | ** > ant publish
|
---|
[14429] | 24 | **
|
---|
[16851] | 25 | **
|
---|
[14429] | 26 | -->
|
---|
| 27 | <project name="tageditor" default="dist" basedir=".">
|
---|
[18488] | 28 |
|
---|
[18955] | 29 |
|
---|
[21026] | 30 | <property name="commit.message" value="Updating to JOSM 3210" />
|
---|
[25191] | 31 | <property name="plugin.main.version" value="3835" />
|
---|
[18488] | 32 |
|
---|
| 33 | <!--
|
---|
[14837] | 34 | ************************************************
|
---|
| 35 | ** should not be necessary to change the following properties
|
---|
| 36 | -->
|
---|
[18955] | 37 | <property name="josm" location="../../core/dist/josm-custom.jar"/>
|
---|
| 38 | <property name="plugin.build.dir" value="build"/>
|
---|
| 39 | <property name="plugin.src.dir" value="src"/>
|
---|
| 40 | <!-- this is the directory where the plugin jar is copied to -->
|
---|
| 41 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
| 42 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
| 43 | <property name="plugin.dist.dir" value="../../dist"/>
|
---|
| 44 | <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
|
---|
| 45 |
|
---|
| 46 | <!--
|
---|
[14837] | 47 | **********************************************************
|
---|
| 48 | ** init - initializes the build
|
---|
| 49 | **********************************************************
|
---|
| 50 | -->
|
---|
[18955] | 51 | <target name="init">
|
---|
| 52 | <mkdir dir="${plugin.build.dir}"/>
|
---|
| 53 | </target>
|
---|
[14837] | 54 |
|
---|
[18955] | 55 | <!--
|
---|
[14837] | 56 | **********************************************************
|
---|
| 57 | ** compile - complies the source tree
|
---|
| 58 | **********************************************************
|
---|
| 59 | -->
|
---|
[18955] | 60 | <target name="compile" depends="init">
|
---|
| 61 | <echo message="compiling sources for ${plugin.jar} ... "/>
|
---|
| 62 | <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
|
---|
| 63 | <compilerarg value="-Xlint:deprecation"/>
|
---|
| 64 | <compilerarg value="-Xlint:unchecked"/>
|
---|
| 65 | </javac>
|
---|
| 66 | </target>
|
---|
[14429] | 67 |
|
---|
[18955] | 68 | <!--
|
---|
[14837] | 69 | **********************************************************
|
---|
| 70 | ** dist - creates the plugin jar
|
---|
| 71 | **********************************************************
|
---|
| 72 | -->
|
---|
[18955] | 73 | <target name="dist" depends="compile,revision">
|
---|
| 74 | <echo message="creating ${plugin.jar} for version ${version.entry.commit.revision} ... "/>
|
---|
| 75 | <copy todir="${plugin.build.dir}/resources">
|
---|
| 76 | <fileset dir="resources"/>
|
---|
| 77 | </copy>
|
---|
| 78 | <copy todir="${plugin.build.dir}">
|
---|
| 79 | <fileset dir=".">
|
---|
| 80 | <include name="README" />
|
---|
| 81 | <include name="LICENSE" />
|
---|
| 82 | </fileset>
|
---|
| 83 | </copy>
|
---|
| 84 | <copy todir="${plugin.build.dir}">
|
---|
| 85 | <fileset dir="${plugin.src.dir}">
|
---|
| 86 | <include name="**/*.dtd"/>
|
---|
| 87 | </fileset>
|
---|
| 88 | </copy>
|
---|
| 89 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
|
---|
| 90 | <manifest>
|
---|
| 91 | <attribute name="Author" value="Karl Guggisberg"/>
|
---|
| 92 | <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.tageditor.TagEditorPlugin"/>
|
---|
| 93 | <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
|
---|
| 94 | <attribute name="Plugin-Description" value="Provides a dialog for editing tags in a tabular grid."/>
|
---|
| 95 | <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/TagEditor"/>
|
---|
| 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>
|
---|
[14837] | 101 |
|
---|
[18955] | 102 | <!--
|
---|
[14837] | 103 | **********************************************************
|
---|
| 104 | ** revision - extracts the current revision number for the
|
---|
| 105 | ** file build.number and stores it in the XML property
|
---|
| 106 | ** version.*
|
---|
| 107 | **********************************************************
|
---|
| 108 | -->
|
---|
[18955] | 109 | <target name="revision">
|
---|
| 110 | <!-- extract the SVN revision information -->
|
---|
| 111 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
---|
| 112 | <env key="LANG" value="C"/>
|
---|
| 113 | <arg value="info"/>
|
---|
| 114 | <arg value="--xml"/>
|
---|
| 115 | <arg value="."/>
|
---|
| 116 | </exec>
|
---|
| 117 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
| 118 | <delete file="REVISION"/>
|
---|
| 119 | </target>
|
---|
| 120 |
|
---|
| 121 | <!--
|
---|
[14837] | 122 | **********************************************************
|
---|
| 123 | ** clean - clean up the build environment
|
---|
| 124 | **********************************************************
|
---|
| 125 | -->
|
---|
[18955] | 126 | <target name="clean">
|
---|
| 127 | <delete dir="${plugin.build.dir}"/>
|
---|
| 128 | <delete file="${plugin.jar}"/>
|
---|
| 129 | </target>
|
---|
[14837] | 130 |
|
---|
[18955] | 131 | <!--
|
---|
[14837] | 132 | **********************************************************
|
---|
| 133 | ** install - install the plugin in your local JOSM installation
|
---|
| 134 | **********************************************************
|
---|
| 135 | -->
|
---|
[18955] | 136 | <target name="install" depends="dist">
|
---|
| 137 | <property environment="env"/>
|
---|
| 138 | <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
|
---|
| 139 | <and>
|
---|
| 140 | <os family="windows"/>
|
---|
| 141 | </and>
|
---|
| 142 | </condition>
|
---|
| 143 | <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
|
---|
| 144 | </target>
|
---|
[16840] | 145 |
|
---|
[18500] | 146 | <!--
|
---|
[18522] | 147 | ************************** Publishing the plugin ***********************************
|
---|
[18500] | 148 | -->
|
---|
[18955] | 149 | <!--
|
---|
| 150 | ** extracts the JOSM release for the JOSM version in ../core and saves it in the
|
---|
| 151 | ** property ${coreversion.info.entry.revision}
|
---|
| 152 | **
|
---|
| 153 | -->
|
---|
| 154 | <target name="core-info">
|
---|
| 155 | <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
|
---|
| 156 | <env key="LANG" value="C"/>
|
---|
| 157 | <arg value="info"/>
|
---|
| 158 | <arg value="--xml"/>
|
---|
| 159 | <arg value="../../core"/>
|
---|
| 160 | </exec>
|
---|
| 161 | <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
|
---|
| 162 | <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
|
---|
| 163 | <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
|
---|
| 164 | <delete file="core.info.xml" />
|
---|
| 165 | </target>
|
---|
[16840] | 166 |
|
---|
[18955] | 167 | <!--
|
---|
| 168 | ** commits the source tree for this plugin
|
---|
| 169 | -->
|
---|
| 170 | <target name="commit-current">
|
---|
| 171 | <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
|
---|
| 172 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
| 173 | <env key="LANG" value="C"/>
|
---|
| 174 | <arg value="commit"/>
|
---|
| 175 | <arg value="-m '${commit.message}'"/>
|
---|
| 176 | <arg value="."/>
|
---|
| 177 | </exec>
|
---|
| 178 | </target>
|
---|
[18522] | 179 |
|
---|
[18955] | 180 | <!--
|
---|
| 181 | ** updates (svn up) the source tree for this plugin
|
---|
| 182 | -->
|
---|
| 183 | <target name="update-current">
|
---|
| 184 | <echo>Updating plugin source ...</echo>
|
---|
| 185 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
| 186 | <env key="LANG" value="C"/>
|
---|
| 187 | <arg value="up"/>
|
---|
| 188 | <arg value="."/>
|
---|
| 189 | </exec>
|
---|
| 190 | <echo>Updating ${plugin.jar} ...</echo>
|
---|
| 191 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
| 192 | <env key="LANG" value="C"/>
|
---|
| 193 | <arg value="up"/>
|
---|
| 194 | <arg value="../dist/${plugin.jar}"/>
|
---|
| 195 | </exec>
|
---|
| 196 | </target>
|
---|
| 197 |
|
---|
| 198 | <!--
|
---|
| 199 | ** commits the plugin.jar
|
---|
| 200 | -->
|
---|
| 201 | <target name="commit-dist">
|
---|
| 202 | <echo>
|
---|
[18522] | 203 | ***** Properties of published ${plugin.jar} *****
|
---|
| 204 | Commit message : '${commit.message}'
|
---|
| 205 | Plugin-Mainversion: ${plugin.main.version}
|
---|
| 206 | JOSM build version: ${coreversion.info.entry.revision}
|
---|
| 207 | Plugin-Version : ${version.entry.commit.revision}
|
---|
| 208 | ***** / Properties of published ${plugin.jar} *****
|
---|
| 209 |
|
---|
| 210 | Now commiting ${plugin.jar} ...
|
---|
[18955] | 211 | </echo>
|
---|
| 212 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
| 213 | <env key="LANG" value="C"/>
|
---|
| 214 | <arg value="-m '${commit.message}'"/>
|
---|
| 215 | <arg value="commit"/>
|
---|
| 216 | <arg value="${plugin.jar}"/>
|
---|
| 217 | </exec>
|
---|
| 218 | </target>
|
---|
| 219 |
|
---|
| 220 | <!-- ** make sure svn is present as a command line tool ** -->
|
---|
| 221 | <target name="ensure-svn-present">
|
---|
[18976] | 222 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
|
---|
[18955] | 223 | <env key="LANG" value="C" />
|
---|
| 224 | <arg value="--version" />
|
---|
| 225 | </exec>
|
---|
[18976] | 226 | <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
|
---|
| 227 | <!-- return code not set at all? Most likely svn isn't installed -->
|
---|
[18955] | 228 | <condition>
|
---|
[18976] | 229 | <not>
|
---|
| 230 | <isset property="svn.exit.code" />
|
---|
| 231 | </not>
|
---|
| 232 | </condition>
|
---|
| 233 | </fail>
|
---|
| 234 | <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
|
---|
| 235 | <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
|
---|
| 236 | <condition>
|
---|
[18955] | 237 | <isfailure code="${svn.exit.code}" />
|
---|
| 238 | </condition>
|
---|
| 239 | </fail>
|
---|
| 240 | </target>
|
---|
[18976] | 241 |
|
---|
[18955] | 242 | <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
|
---|
| 243 | </target>
|
---|
[14334] | 244 | </project>
|
---|