Changeset 19672 in osm for applications/editors/josm
- Timestamp:
- 2010-01-30T17:53:33+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/photo_geotagging/build.xml
r19671 r19672 14 14 ** dialog. You have to check it in first. 15 15 ** 16 ** Use the ant target 'publish' to check in the plugin and make it available to other 17 ** JOSM users: 18 ** set the properties commit.message and plugin.main.version 19 ** and run 20 ** > ant publish 21 ** 22 ** 16 23 --> 17 24 <project name="photo_geotagging" default="dist" basedir="."> 18 <!-- 25 26 <!-- enter the SVN commit message --> 27 <property name="commit.message" value="josm plugin photo_geotagging: update" /> 28 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 29 <property name="plugin.main.version" value="2904" /> 30 31 32 <!-- 19 33 ************************************************ 20 34 ** should not be necessary to change the following properties 21 35 --> 22 23 24 25 26 27 28 29 30 31 36 <property name="josm" location="../../core/dist/josm-custom.jar"/> 37 <property name="plugin.build.dir" value="build"/> 38 <property name="plugin.src.dir" value="src"/> 39 <!-- this is the directory where the plugin jar is copied to --> 40 <property name="plugin.dist.dir" value="../../dist"/> 41 <property name="ant.build.javac.target" value="1.5"/> 42 <property name="plugin.dist.dir" value="../../dist"/> 43 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/> 44 45 <!-- 32 46 ********************************************************** 33 47 ** init - initializes the build 34 48 ********************************************************** 35 49 --> 36 37 38 39 40 50 <target name="init"> 51 <mkdir dir="${plugin.build.dir}"/> 52 </target> 53 54 <!-- 41 55 ********************************************************** 42 56 ** compile - complies the source tree 43 57 ********************************************************** 44 58 --> 45 46 47 48 49 50 51 52 53 59 <target name="compile" depends="init"> 60 <echo message="compiling sources for ${plugin.jar} ... "/> 61 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 62 <compilerarg value="-Xlint:deprecation"/> 63 <compilerarg value="-Xlint:unchecked"/> 64 </javac> 65 </target> 66 67 <!-- 54 68 ********************************************************** 55 69 ** dist - creates the plugin jar 56 70 ********************************************************** 57 71 --> 58 59 60 61 62 63 64 65 66 67 68 69 72 <target name="dist" depends="compile,revision"> 73 <echo message="creating ${ant.project.name}.jar ... "/> 74 <copy todir="${plugin.build.dir}/images"> 75 <fileset dir="images"/> 76 </copy> 77 <copy todir="${plugin.build.dir}"> 78 <fileset dir="."> 79 <include name="README" /> 80 </fileset> 81 </copy> 82 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}"> 83 <!-- 70 84 ************************************************ 71 85 ** configure these properties. Most of them will be copied to the plugins … … 75 89 ************************************************ 76 90 --> 77 78 79 80 81 82 83 2904"/>84 85 86 87 88 89 91 <manifest> 92 <attribute name="Author" value="Sebastian Klein"/> 93 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.photo_geotagging.GeotaggingPlugin"/> 94 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 95 <attribute name="Plugin-Description" value="Write gps position info to the image file header. Run this feature from the right click menu of the image layer."/> 96 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/Photo_Geotagging"/> 97 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/> 98 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 99 </manifest> 100 </jar> 101 </target> 102 103 <!-- 90 104 ********************************************************** 91 105 ** revision - extracts the current revision number for the … … 94 108 ********************************************************** 95 109 --> 96 97 98 99 100 101 102 103 104 105 106 107 108 110 <target name="revision"> 111 112 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false"> 113 <env key="LANG" value="C"/> 114 <arg value="info"/> 115 <arg value="--xml"/> 116 <arg value="."/> 117 </exec> 118 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/> 119 <delete file="REVISION"/> 120 </target> 121 122 <!-- 109 123 ********************************************************** 110 124 ** clean - clean up the build environment 111 125 ********************************************************** 112 126 --> 113 114 115 116 117 118 127 <target name="clean"> 128 <delete dir="${plugin.build.dir}"/> 129 <delete file="${plugin.jar}"/> 130 </target> 131 132 <!-- 119 133 ********************************************************** 120 134 ** install - install the plugin in your local JOSM installation 121 135 ********************************************************** 122 136 --> 123 <target name="install" depends="dist"> 124 <property environment="env"/> 125 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins"> 126 <and> 127 <os family="windows"/> 128 </and> 129 </condition> 130 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/> 131 </target> 137 <target name="install" depends="dist"> 138 <property environment="env"/> 139 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins"> 140 <and> 141 <os family="windows"/> 142 </and> 143 </condition> 144 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/> 145 </target> 146 147 148 <!-- 149 ************************** Publishing the plugin *********************************** 150 --> 151 <!-- 152 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 153 ** property ${coreversion.info.entry.revision} 154 ** 155 --> 156 <target name="core-info"> 157 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false"> 158 <env key="LANG" value="C"/> 159 <arg value="info"/> 160 <arg value="--xml"/> 161 <arg value="../../core"/> 162 </exec> 163 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/> 164 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo> 165 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo> 166 <delete file="core.info.xml" /> 167 </target> 168 169 <!-- 170 ** commits the source tree for this plugin 171 --> 172 <target name="commit-current"> 173 <echo>Commiting the plugin source with message '${commit.message}' ...</echo> 174 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 175 <env key="LANG" value="C"/> 176 <arg value="commit"/> 177 <arg value="-m '${commit.message}'"/> 178 <arg value="."/> 179 </exec> 180 </target> 181 182 <!-- 183 ** updates (svn up) the source tree for this plugin 184 --> 185 <target name="update-current"> 186 <echo>Updating plugin source ...</echo> 187 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 188 <env key="LANG" value="C"/> 189 <arg value="up"/> 190 <arg value="."/> 191 </exec> 192 <echo>Updating ${plugin.jar} ...</echo> 193 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 194 <env key="LANG" value="C"/> 195 <arg value="up"/> 196 <arg value="../dist/${plugin.jar}"/> 197 </exec> 198 </target> 199 200 <!-- 201 ** commits the plugin.jar 202 --> 203 <target name="commit-dist"> 204 <echo> 205 ***** Properties of published ${plugin.jar} ***** 206 Commit message : '${commit.message}' 207 Plugin-Mainversion: ${plugin.main.version} 208 JOSM build version: ${coreversion.info.entry.revision} 209 Plugin-Version : ${version.entry.commit.revision} 210 ***** / Properties of published ${plugin.jar} ***** 211 212 Now commiting ${plugin.jar} ... 213 </echo> 214 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 215 <env key="LANG" value="C"/> 216 <arg value="-m '${commit.message}'"/> 217 <arg value="commit"/> 218 <arg value="${plugin.jar}"/> 219 </exec> 220 </target> 221 222 <!-- ** make sure svn is present as a command line tool ** --> 223 <target name="ensure-svn-present"> 224 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code"> 225 <env key="LANG" value="C" /> 226 <arg value="--version" /> 227 </exec> 228 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system."> 229 <!-- return code not set at all? Most likely svn isn't installed --> 230 <condition> 231 <not> 232 <isset property="svn.exit.code" /> 233 </not> 234 </condition> 235 </fail> 236 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system."> 237 <!-- error code from SVN? Most likely svn is not what we are looking on this system --> 238 <condition> 239 <isfailure code="${svn.exit.code}" /> 240 </condition> 241 </fail> 242 </target> 243 244 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist"> 245 </target> 132 246 </project>
Note:
See TracChangeset
for help on using the changeset viewer.