Changeset 19456 in osm for applications/editors/josm/plugins/multipoly/build.xml
- Timestamp:
- 2010-01-13T14:53:35+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/multipoly/build.xml
r18962 r19456 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!-- 3 ** This is the build file for the multipoly 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 --> 1 30 <project name="multipoly" default="dist" basedir="."> 2 31 3 <!-- compilation properties --> 4 <property name="josm.build.dir" value="../../core"/> 5 <property name="josm.home.dir" value="${user.home}/.josm"/> 6 <property name="josm" location="../../core/dist/josm-custom.jar" /> 7 <property name="plugin.build.dir" value="build"/> 8 <property name="plugin.dist.dir" value="../../dist"/> 9 <property name="plugin.name" value="${ant.project.name}"/> 10 <property name="plugin.jar" value="${plugin.dist.dir}/${plugin.name}.jar"/> 11 12 <!-- There's no josm.jar in the svn, so point "josm" to a local copy of your JOSM binary --> 13 <property name="josm" location="../../core/dist/josm-custom.jar" /> 14 15 <property name="ant.build.javac.target" value="1.5"/> 16 17 <target name="init"> 18 <mkdir dir="${plugin.build.dir}"></mkdir> 19 <mkdir dir="${plugin.dist.dir}"></mkdir> 20 </target> 21 22 <target name="compile" depends="init"> 23 <echo message="creating ${plugin.jar}"/> 24 <javac srcdir="src" target="1.5" classpath="${josm}" destdir="build" debug="true"> 25 <include name="**/*.java" /> 26 </javac> 27 </target> 28 29 <target name="revision"> 30 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false"> 31 <env key="LANG" value="C"/> 32 <arg value="info"/> 33 <arg value="--xml"/> 34 <arg value="."/> 35 </exec> 36 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/> 37 <delete file="REVISION"/> 38 </target> 39 40 <target name="dist" depends="compile,revision"> 41 <copy todir="${plugin.build.dir}/images"> 42 <fileset dir="images"/> 43 </copy> 44 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}"> 45 <manifest> 46 <attribute name="Author" value="Bilbo"/> 47 <attribute name="Plugin-Class" value="multipoly.MultipolyPlugin" /> 48 <attribute name="Plugin-Description" value="Create multipolygons by one click, much easier than standard way with relation editor." /> 49 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 50 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 51 <attribute name="Plugin-Link" value="http://svn.openstreetmap.org/applications/editors/josm/plugins/multipoly/"/> 52 <attribute name="Plugin-Mainversion" value="2578"/> 53 </manifest> 54 </jar> 55 </target> 56 57 <target name="clean"> 58 <delete dir="${plugin.build.dir}" /> 59 <delete file="${plugin.jar}" /> 60 </target> 61 62 <target name="clean_install"> 63 <delete file="${plugins}/multipoly.jar" /> 64 </target> 65 66 <target name="install" depends="dist"> 67 <property environment="env"/> 68 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins"> 69 <and> 70 <os family="windows"/> 71 </and> 72 </condition> 73 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/> 74 </target> 32 33 <!-- enter the SVN commit message --> 34 <property name="commit.message" value="Changed the constructor signature of the plugin main class" /> 35 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 36 <property name="plugin.main.version" value="2830" /> 37 38 39 <!-- compilation properties --> 40 <property name="josm.build.dir" value="../../core" /> 41 <property name="josm.home.dir" value="${user.home}/.josm" /> 42 <property name="josm" location="../../core/dist/josm-custom.jar" /> 43 <property name="plugin.build.dir" value="build" /> 44 <property name="plugin.dist.dir" value="../../dist" /> 45 <property name="plugin.name" value="${ant.project.name}" /> 46 <property name="plugin.jar" value="${plugin.dist.dir}/${plugin.name}.jar" /> 47 48 <!-- There's no josm.jar in the svn, so point "josm" to a local copy of your JOSM binary --> 49 <property name="josm" location="../../core/dist/josm-custom.jar" /> 50 51 <property name="ant.build.javac.target" value="1.5" /> 52 53 <target name="init"> 54 <mkdir dir="${plugin.build.dir}"> 55 </mkdir> 56 <mkdir dir="${plugin.dist.dir}"> 57 </mkdir> 58 </target> 59 60 <target name="compile" depends="init"> 61 <echo message="creating ${plugin.jar}" /> 62 <javac srcdir="src" target="1.5" classpath="${josm}" destdir="build" debug="true"> 63 <include name="**/*.java" /> 64 </javac> 65 </target> 66 67 <target name="revision"> 68 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false"> 69 <env key="LANG" value="C" /> 70 <arg value="info" /> 71 <arg value="--xml" /> 72 <arg value="." /> 73 </exec> 74 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true" /> 75 <delete file="REVISION" /> 76 </target> 77 78 <target name="dist" depends="compile,revision"> 79 <copy todir="${plugin.build.dir}/images"> 80 <fileset dir="images" /> 81 </copy> 82 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}"> 83 <manifest> 84 <attribute name="Author" value="Bilbo" /> 85 <attribute name="Plugin-Class" value="multipoly.MultipolyPlugin" /> 86 <attribute name="Plugin-Description" value="Create multipolygons by one click, much easier than standard way with relation editor." /> 87 <attribute name="Plugin-Version" value="${version.entry.commit.revision}" /> 88 <attribute name="Plugin-Date" value="${version.entry.commit.date}" /> 89 <attribute name="Plugin-Link" value="http://svn.openstreetmap.org/applications/editors/josm/plugins/multipoly/" /> 90 <attribute name="Plugin-Mainversion" value="${plugin.main.version}" /> 91 </manifest> 92 </jar> 93 </target> 94 95 <target name="clean"> 96 <delete dir="${plugin.build.dir}" /> 97 <delete file="${plugin.jar}" /> 98 </target> 99 100 <target name="clean_install"> 101 <delete file="${plugins}/multipoly.jar" /> 102 </target> 103 104 <target name="install" depends="dist"> 105 <property environment="env" /> 106 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins"> 107 <and> 108 <os family="windows" /> 109 </and> 110 </condition> 111 <copy file="${plugin.jar}" todir="${josm.plugins.dir}" /> 112 </target> 113 114 <!-- 115 ************************** Publishing the plugin *********************************** 116 --> 117 <!-- 118 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 119 ** property ${coreversion.info.entry.revision} 120 ** 121 --> 122 <target name="core-info"> 123 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false"> 124 <env key="LANG" value="C" /> 125 <arg value="info" /> 126 <arg value="--xml" /> 127 <arg value="../../core" /> 128 </exec> 129 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true" /> 130 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo> 131 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo> 132 <delete file="core.info.xml" /> 133 </target> 134 135 <!-- 136 ** commits the source tree for this plugin 137 --> 138 <target name="commit-current"> 139 <echo>Commiting the plugin source with message '${commit.message}' ...</echo> 140 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 141 <env key="LANG" value="C" /> 142 <arg value="commit" /> 143 <arg value="-m '${commit.message}'" /> 144 <arg value="." /> 145 </exec> 146 </target> 147 148 <!-- 149 ** updates (svn up) the source tree for this plugin 150 --> 151 <target name="update-current"> 152 <echo>Updating plugin source ...</echo> 153 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 154 <env key="LANG" value="C" /> 155 <arg value="up" /> 156 <arg value="." /> 157 </exec> 158 <echo>Updating ${plugin.jar} ...</echo> 159 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 160 <env key="LANG" value="C" /> 161 <arg value="up" /> 162 <arg value="../dist/${plugin.jar}" /> 163 </exec> 164 </target> 165 166 <!-- 167 ** commits the plugin.jar 168 --> 169 <target name="commit-dist"> 170 <echo> 171 ***** Properties of published ${plugin.jar} ***** 172 Commit message : '${commit.message}' 173 Plugin-Mainversion: ${plugin.main.version} 174 JOSM build version: ${coreversion.info.entry.revision} 175 Plugin-Version : ${version.entry.commit.revision} 176 ***** / Properties of published ${plugin.jar} ***** 177 178 Now commiting ${plugin.jar} ... 179 </echo> 180 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 181 <env key="LANG" value="C" /> 182 <arg value="-m '${commit.message}'" /> 183 <arg value="commit" /> 184 <arg value="${plugin.jar}" /> 185 </exec> 186 </target> 187 188 <!-- ** make sure svn is present as a command line tool ** --> 189 <target name="ensure-svn-present"> 190 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code"> 191 <env key="LANG" value="C" /> 192 <arg value="--version" /> 193 </exec> 194 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system."> 195 <!-- return code not set at all? Most likely svn isn't installed --> 196 <condition> 197 <not> 198 <isset property="svn.exit.code" /> 199 </not> 200 </condition> 201 </fail> 202 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system."> 203 <!-- error code from SVN? Most likely svn is not what we are looking on this system --> 204 <condition> 205 <isfailure code="${svn.exit.code}" /> 206 </condition> 207 </fail> 208 </target> 209 210 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist"> 211 </target> 75 212 76 213 </project>
Note:
See TracChangeset
for help on using the changeset viewer.
