Changeset 26174 in osm for applications/editors/josm/plugins/routing
- Timestamp:
- 2011-06-25T19:02:31+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/routing
- Files:
-
- 31 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/routing/build.xml
r26119 r26174 1 <?xml version="1.0" encoding=" UTF-8"?>1 <?xml version="1.0" encoding="utf-8"?> 2 2 <!-- 3 3 ** This is the build file for the routing plugin … … 26 26 --> 27 27 <project name="routing" default="dist" basedir="."> 28 <property name="commit.message" value="Changed the constructor signature of the plugin main class"/> 29 <property name="plugin.main.version" value="3835"/> 30 <!-- Define some properties --> 31 <property name="josm" location="../../core/dist/josm-custom.jar"/> 32 <property name="plugin.dist.dir" value="../../dist"/> 33 <property name="plugin.build.dir" value="build"/> 34 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/> 35 <property name="libdir" location="lib"/> 36 <property name="jgrapht" value="${libdir}/jgrapht-jdk1.5.jar"/> 37 <property name="log4j" value="${libdir}/log4j-1.2.15.jar"/> 38 <property name="ant.build.javac.target" value="1.5"/> 39 <!-- Some initializations for several other targets --> 40 <target name="init"> 41 <mkdir dir="${plugin.dist.dir}"/> 42 <mkdir dir="${plugin.build.dir}"/> 43 </target> 44 <!-- Compile sources --> 45 <target name="compile" depends="init" description="Compile sources"> 46 <echo message="creating ${plugin.jar}"/> 47 <javac srcdir="src" debug="true" destdir="${plugin.build.dir}"> 48 <compilerarg value="-Xlint:deprecation"/> 49 <compilerarg value="-Xlint:unchecked"/> 50 <classpath> 51 <pathelement location="${josm}"/> 52 <pathelement location="${jgrapht}"/> 53 <pathelement location="${log4j}"/> 54 </classpath> 55 </javac> 56 </target> 57 <!-- Generate distribution --> 58 <target name="dist" depends="compile,revision" description="Generate distribution"> 59 <unjar dest="${plugin.build.dir}" src="${jgrapht}"/> 60 <unjar dest="${plugin.build.dir}" src="${log4j}"/> 61 <copy todir="${plugin.build.dir}/"> 62 <fileset dir="resources"> 63 <include name="*.xml"/> 64 </fileset> 65 </copy> 66 <copy todir="${plugin.build.dir}/images"> 67 <fileset dir="images"/> 68 </copy> 69 <copy todir="${plugin.build.dir}/data"> 70 <fileset dir="data"/> 71 </copy> 72 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}"> 73 <manifest> 74 <attribute name="Author" value="Jose Vidal <vidalfree@gmail.com>, Juangui Jordán <juangui@gmail.com>, Hassan S <hassan.sabirin@gmail.com>"/> 75 <attribute name="Plugin-Class" value="com.innovant.josm.plugin.routing.RoutingPlugin"/> 76 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 77 <attribute name="Plugin-Description" value="Provides routing capabilities."/> 78 <attribute name="Plugin-Icon" value="images/preferences/routing.png"/> 79 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Routing"/> 80 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/> 81 <attribute name="Plugin-Stage" value="50"/> 82 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 83 </manifest> 84 </jar> 85 </target> 86 <target name="revision"> 87 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false"> 88 <env key="LANG" value="C"/> 89 <arg value="info"/> 90 <arg value="--xml"/> 91 <arg value="."/> 92 </exec> 93 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/> 94 <delete file="REVISION"/> 95 </target> 96 <target name="clean"> 97 <delete dir="${plugin.build.dir}"/> 98 <delete file="${plugin.jar}"/> 99 </target> 100 <target name="install" depends="dist"> 101 <property environment="env"/> 102 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins"> 103 <and> 104 <os family="windows"/> 105 </and> 106 </condition> 107 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/> 108 </target> 109 <!-- 110 ************************** Publishing the plugin *********************************** 111 --> 112 <!-- 113 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 114 ** property ${coreversion.info.entry.revision} 115 ** 116 --> 117 <target name="core-info"> 118 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false"> 119 <env key="LANG" value="C"/> 120 <arg value="info"/> 121 <arg value="--xml"/> 122 <arg value="../../core"/> 123 </exec> 124 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/> 125 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo> 126 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo> 127 <delete file="core.info.xml"/> 128 </target> 129 <!-- 130 ** commits the source tree for this plugin 131 --> 132 <target name="commit-current"> 133 <echo>Commiting the plugin source with message '${commit.message}' ...</echo> 134 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 135 <env key="LANG" value="C"/> 136 <arg value="commit"/> 137 <arg value="-m '${commit.message}'"/> 138 <arg value="."/> 139 </exec> 140 </target> 141 <!-- 142 ** updates (svn up) the source tree for this plugin 143 --> 144 <target name="update-current"> 145 <echo>Updating plugin source ...</echo> 146 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 147 <env key="LANG" value="C"/> 148 <arg value="up"/> 149 <arg value="."/> 150 </exec> 151 <echo>Updating ${plugin.jar} ...</echo> 152 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 153 <env key="LANG" value="C"/> 154 <arg value="up"/> 155 <arg value="../dist/${plugin.jar}"/> 156 </exec> 157 </target> 158 <!-- 159 ** commits the plugin.jar 160 --> 161 <target name="commit-dist"> 162 <echo> 163 ***** Properties of published ${plugin.jar} ***** 164 Commit message : '${commit.message}' 165 Plugin-Mainversion: ${plugin.main.version} 166 JOSM build version: ${coreversion.info.entry.revision} 167 Plugin-Version : ${version.entry.commit.revision} 168 ***** / Properties of published ${plugin.jar} ***** 28 169 29 <property name="commit.message" value="Changed the constructor signature of the plugin main class" /> 30 <property name="plugin.main.version" value="3835" /> 31 32 <!-- Define some properties --> 33 <property name="josm" location="../../core/dist/josm-custom.jar"/> 34 <property name="plugin.dist.dir" value="../../dist"/> 35 <property name="plugin.build.dir" value="build"/> 36 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/> 37 <property name="libdir" location="lib"/> 38 <property name="jgrapht" value="${libdir}/jgrapht-jdk1.5.jar"/> 39 <property name="log4j" value="${libdir}/log4j-1.2.15.jar"/> 40 <property name="ant.build.javac.target" value="1.5"/> 41 <!-- Some initializations for several other targets --> 42 <target name="init"> 43 <mkdir dir="${plugin.dist.dir}"/> 44 <mkdir dir="${plugin.build.dir}"/> 45 </target> 46 <!-- Compile sources --> 47 <target name="compile" depends="init" description="Compile sources"> 48 <echo message="creating ${plugin.jar}"/> 49 <javac srcdir="src" debug="true" destdir="${plugin.build.dir}"> 50 <compilerarg value="-Xlint:deprecation"/> 51 <compilerarg value="-Xlint:unchecked"/> 52 <classpath> 53 <pathelement location="${josm}"/> 54 <pathelement location="${jgrapht}"/> 55 <pathelement location="${log4j}"/> 56 </classpath> 57 </javac> 58 </target> 59 <!-- Generate distribution --> 60 <target name="dist" depends="compile,revision" description="Generate distribution"> 61 <unjar dest="${plugin.build.dir}" src="${jgrapht}"/> 62 <unjar dest="${plugin.build.dir}" src="${log4j}"/> 63 <copy todir="${plugin.build.dir}/"> 64 <fileset dir="resources"> 65 <include name="*.xml"/> 66 </fileset> 67 </copy> 68 <copy todir="${plugin.build.dir}/images"> 69 <fileset dir="images"/> 70 </copy> 71 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}"> 72 <manifest> 73 <attribute name="Author" value="Jose Vidal <vidalfree@gmail.com>, Juangui Jordán <juangui@gmail.com>, Hassan S <hassan.sabirin@gmail.com>"/> 74 <attribute name="Plugin-Class" value="com.innovant.josm.plugin.routing.RoutingPlugin"/> 75 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 76 <attribute name="Plugin-Description" value="Provides routing capabilities."/> 77 <attribute name="Plugin-Icon" value="images/preferences/routing.png"/> 78 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Routing"/> 79 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/> 80 <attribute name="Plugin-Stage" value="50"/> 81 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 82 </manifest> 83 </jar> 84 </target> 85 <target name="revision"> 86 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false"> 87 <env key="LANG" value="C"/> 88 <arg value="info"/> 89 <arg value="--xml"/> 90 <arg value="."/> 91 </exec> 92 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/> 93 <delete file="REVISION"/> 94 </target> 95 <target name="clean"> 96 <delete dir="${plugin.build.dir}"/> 97 <delete file="${plugin.jar}"/> 98 </target> 99 <target name="install" depends="dist"> 100 <property environment="env"/> 101 <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins"> 102 <and> 103 <os family="windows"/> 104 </and> 105 </condition> 106 <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/> 107 </target> 108 109 <!-- 110 ************************** Publishing the plugin *********************************** 111 --> 112 <!-- 113 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 114 ** property ${coreversion.info.entry.revision} 115 ** 116 --> 117 <target name="core-info"> 118 <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false"> 119 <env key="LANG" value="C"/> 120 <arg value="info"/> 121 <arg value="--xml"/> 122 <arg value="../../core"/> 123 </exec> 124 <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/> 125 <echo>Building against core revision ${coreversion.info.entry.revision}.</echo> 126 <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo> 127 <delete file="core.info.xml" /> 128 </target> 129 130 <!-- 131 ** commits the source tree for this plugin 132 --> 133 <target name="commit-current"> 134 <echo>Commiting the plugin source with message '${commit.message}' ...</echo> 135 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 136 <env key="LANG" value="C"/> 137 <arg value="commit"/> 138 <arg value="-m '${commit.message}'"/> 139 <arg value="."/> 140 </exec> 141 </target> 142 143 <!-- 144 ** updates (svn up) the source tree for this plugin 145 --> 146 <target name="update-current"> 147 <echo>Updating plugin source ...</echo> 148 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 149 <env key="LANG" value="C"/> 150 <arg value="up"/> 151 <arg value="."/> 152 </exec> 153 <echo>Updating ${plugin.jar} ...</echo> 154 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 155 <env key="LANG" value="C"/> 156 <arg value="up"/> 157 <arg value="../dist/${plugin.jar}"/> 158 </exec> 159 </target> 160 161 <!-- 162 ** commits the plugin.jar 163 --> 164 <target name="commit-dist"> 165 <echo> 166 ***** Properties of published ${plugin.jar} ***** 167 Commit message : '${commit.message}' 168 Plugin-Mainversion: ${plugin.main.version} 169 JOSM build version: ${coreversion.info.entry.revision} 170 Plugin-Version : ${version.entry.commit.revision} 171 ***** / Properties of published ${plugin.jar} ***** 172 173 Now commiting ${plugin.jar} ... 174 </echo> 175 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 176 <env key="LANG" value="C"/> 177 <arg value="-m '${commit.message}'"/> 178 <arg value="commit"/> 179 <arg value="${plugin.jar}"/> 180 </exec> 181 </target> 182 183 <!-- ** make sure svn is present as a command line tool ** --> 184 <target name="ensure-svn-present"> 185 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code"> 186 <env key="LANG" value="C" /> 187 <arg value="--version" /> 188 </exec> 189 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system."> 190 <!-- return code not set at all? Most likely svn isn't installed --> 191 <condition> 192 <not> 193 <isset property="svn.exit.code" /> 194 </not> 195 </condition> 196 </fail> 197 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system."> 198 <!-- error code from SVN? Most likely svn is not what we are looking on this system --> 199 <condition> 200 <isfailure code="${svn.exit.code}" /> 201 </condition> 202 </fail> 203 </target> 204 205 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist"> 206 </target> 170 Now commiting ${plugin.jar} ... 171 </echo> 172 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false"> 173 <env key="LANG" value="C"/> 174 <arg value="-m '${commit.message}'"/> 175 <arg value="commit"/> 176 <arg value="${plugin.jar}"/> 177 </exec> 178 </target> 179 <!-- ** make sure svn is present as a command line tool ** --> 180 <target name="ensure-svn-present"> 181 <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code"> 182 <env key="LANG" value="C"/> 183 <arg value="--version"/> 184 </exec> 185 <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system."> 186 <!-- return code not set at all? Most likely svn isn't installed --> 187 <condition> 188 <not> 189 <isset property="svn.exit.code"/> 190 </not> 191 </condition> 192 </fail> 193 <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system."> 194 <!-- error code from SVN? Most likely svn is not what we are looking on this system --> 195 <condition> 196 <isfailure code="${svn.exit.code}"/> 197 </condition> 198 </fail> 199 </target> 200 <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist"> 201 </target> 207 202 </project>
Note:
See TracChangeset
for help on using the changeset viewer.