[26341] | 1 | <?xml version="1.0" encoding="utf-8"?>
|
---|
| 2 | <!--
|
---|
| 3 | ** Template for the build targets common to all plugins
|
---|
| 4 | ** ====================================================
|
---|
| 5 | **
|
---|
| 6 | ** To override a property, add it to the plugin build.xml _before_
|
---|
| 7 | ** this template has been imported.
|
---|
| 8 | ** To override a target, add it _after_ this template has been imported.
|
---|
| 9 | **
|
---|
| 10 | ** Paths are relative to the build.xml that imports this template.
|
---|
| 11 | **
|
---|
| 12 | -->
|
---|
[34601] | 13 | <project name="plugin_common" basedir="." xmlns:jacoco="antlib:org.jacoco.ant" xmlns:if="ant:if" xmlns:unless="ant:unless" xmlns:ivy="antlib:org.apache.ivy.ant">
|
---|
[26341] | 14 |
|
---|
[31508] | 15 | <property name="josm" location="../../core/dist/josm-custom.jar"/>
|
---|
[35411] | 16 | <property name="josm.ivy" location="../../core/ivy.xml"/>
|
---|
[35413] | 17 | <property name="josm.ivysettings" location="../../core/ivysettings.xml"/>
|
---|
[31508] | 18 | <property name="josm.test.build.dir" location="../../core/test/build"/>
|
---|
[34795] | 19 | <property name="jmockit.jar" location="../00_core_test_lib/jmockit.jar"/>
|
---|
[34620] | 20 | <property name="error_prone_core.jar" location="../00_core_tools/error_prone_core.jar"/>
|
---|
| 21 | <property name="error_prone_javac.jar" location="../00_core_tools/error_prone_javac.jar"/>
|
---|
[35342] | 22 | <property name="auto-value-annotations.jar" location="../00_core_tools/auto-value-annotations.jar"/>
|
---|
[35344] | 23 | <property name="dataflow.jar" location="../00_core_tools/dataflow-shaded.jar"/>
|
---|
[34889] | 24 | <property name="javacutil.jar" location="../00_core_tools/javacutil.jar"/>
|
---|
[34887] | 25 | <property name="failureaccess.jar" location="../00_core_tools/failureaccess.jar"/>
|
---|
[33491] | 26 | <property name="checkstyle-build.dir" location="../00_core_tools/checkstyle/build"/>
|
---|
[34887] | 27 | <property name="jformatstring.jar" location="../00_core_tools/spotbugs/jFormatString-3.0.0.jar"/>
|
---|
[33591] | 28 | <property name="annotations.jar" location="../00_core_tools/spotbugs/spotbugs-annotations.jar"/>
|
---|
[35378] | 29 | <property name="core.tools.ivy" location="../00_core_tools/ivy.xml"/>
|
---|
[34409] | 30 | <property name="plugin.tools.dir" location="../00_tools"/>
|
---|
[30550] | 31 | <property name="plugin.build.dir" location="build"/>
|
---|
| 32 | <property name="plugin.test.dir" location="test"/>
|
---|
| 33 | <property name="plugin.src.dir" location="src"/>
|
---|
[34677] | 34 | <property name="plugin.resources.dir" location="resources"/>
|
---|
[34045] | 35 | <property name="plugin.doc.dir" location="javadoc"/>
|
---|
[30550] | 36 | <property name="plugin.lib.dir" location="lib"/>
|
---|
[26341] | 37 | <!-- this is the directory where the plugin jar is copied to -->
|
---|
[30550] | 38 | <property name="plugin.dist.dir" location="../../dist"/>
|
---|
[34364] | 39 | <property name="java.lang.version" value="1.8" />
|
---|
[34873] | 40 | <property name="javadoc.executable" value="javadoc" />
|
---|
[34874] | 41 | <property name="javadoc.link" value="https://docs.oracle.com/javase/8/docs/api" />
|
---|
[34703] | 42 | <property name="manifest" value="MANIFEST"/>
|
---|
| 43 | <property name="manifest.unixoid" value="MANIFEST-unixoid"/>
|
---|
| 44 | <property name="manifest.windows" value="MANIFEST-windows"/>
|
---|
| 45 | <property name="manifest.osx" value="MANIFEST-osx"/>
|
---|
[30550] | 46 | <property name="plugin.jar" location="${plugin.dist.dir}/${ant.project.name}.jar"/>
|
---|
[34703] | 47 | <property name="plugin.unixoid.jar" location="${plugin.dist.dir}/${ant.project.name}-unixoid.jar"/>
|
---|
| 48 | <property name="plugin.windows.jar" location="${plugin.dist.dir}/${ant.project.name}-windows.jar"/>
|
---|
| 49 | <property name="plugin.osx.jar" location="${plugin.dist.dir}/${ant.project.name}-osx.jar"/>
|
---|
[34244] | 50 | <property name="plugin.sources.jar" location="${plugin.dist.dir}/${ant.project.name}-sources.jar"/>
|
---|
| 51 | <property name="plugin.javadoc.jar" location="${plugin.dist.dir}/${ant.project.name}-javadoc.jar"/>
|
---|
[34581] | 52 | <property name="ivy.home" location="${user.home}/.ant"/>
|
---|
| 53 | <property name="ivy.jar.dir" location="${ivy.home}/lib"/>
|
---|
| 54 | <property name="ivy.jar.file" location="${ivy.jar.dir}/ivy.jar"/>
|
---|
[35390] | 55 | <property name="ivy.version" value="2.5.0"/>
|
---|
[26341] | 56 |
|
---|
[34703] | 57 | <!-- For platform-specific stuff -->
|
---|
| 58 | <condition property="isWindows"><os family="Windows"/></condition>
|
---|
| 59 | <condition property="isUnix"><os family="Unix"/></condition>
|
---|
| 60 | <condition property="isMac"><os family="Mac"/></condition>
|
---|
[34620] | 61 | <!-- For Java specific stuff by version -->
|
---|
| 62 | <condition property="isJava9"><matches string="${ant.java.version}" pattern="(1.)?(9|1[0-9])" /></condition>
|
---|
| 63 | <condition property="isJava10"><matches string="${ant.java.version}" pattern="1[0-9]" /></condition>
|
---|
| 64 | <condition property="isJava11"><matches string="${ant.java.version}" pattern="1[1-9]" /></condition>
|
---|
| 65 | <condition property="isJava12"><matches string="${ant.java.version}" pattern="1[2-9]" /></condition>
|
---|
| 66 | <condition property="isJava13"><matches string="${ant.java.version}" pattern="1[3-9]" /></condition>
|
---|
[35374] | 67 | <condition property="isJava16"><matches string="${ant.java.version}" pattern="1[6-9]" /></condition>
|
---|
| 68 | <!-- Disable jacoco on Java 16+, see https://github.com/jacoco/jacoco/pull/992 -->
|
---|
[34363] | 69 | <condition property="coverageByDefault">
|
---|
| 70 | <not>
|
---|
[35374] | 71 | <isset property="isJava16"/>
|
---|
[34363] | 72 | </not>
|
---|
| 73 | </condition>
|
---|
[34376] | 74 | <target name="-jaxb_windows" if="isWindows">
|
---|
[34578] | 75 | <property name="xjc" value="${plugin.tools.dir}${file.separator}jaxb-ri${file.separator}bin${file.separator}xjc.bat" />
|
---|
[30699] | 76 | </target>
|
---|
[34376] | 77 | <target name="-jaxb_linux" unless="isWindows">
|
---|
[34578] | 78 | <property name="xjc" value="${plugin.tools.dir}${file.separator}jaxb-ri${file.separator}bin${file.separator}xjc.sh" />
|
---|
[34376] | 79 | </target>
|
---|
[30699] | 80 |
|
---|
[30747] | 81 | <!-- To be overriden in plugin build file before inclusion if other plugins are required -->
|
---|
| 82 | <fileset id="plugin.requires.jars" dir="${plugin.dist.dir}" includes="nothing"/>
|
---|
| 83 |
|
---|
[34409] | 84 | <fileset id="jaxb.jars" dir="${plugin.tools.dir}/jaxb-ri/lib" includes="**/*.jar"/>
|
---|
| 85 |
|
---|
[35010] | 86 | <path id="jdk8.boot.classpath">
|
---|
| 87 | <pathelement location="${error_prone_javac.jar}"/>
|
---|
| 88 | <fileset refid="jaxb.jars"/>
|
---|
| 89 | </path>
|
---|
[32312] | 90 | <path id="plugin.classpath">
|
---|
| 91 | <pathelement location="${josm}"/>
|
---|
| 92 | <fileset dir="${plugin.lib.dir}" erroronmissingdir="no">
|
---|
| 93 | <include name="**/*.jar"/>
|
---|
| 94 | <exclude name="**/*-sources.jar"/>
|
---|
| 95 | <exclude name="**/*-javadoc.jar"/>
|
---|
[34703] | 96 | <exclude name="**/*-unixoid.jar" unless="isUnix"/>
|
---|
| 97 | <exclude name="**/*-windows.jar" unless="isWindows"/>
|
---|
| 98 | <exclude name="**/*-osx.jar" unless="isMac"/>
|
---|
[32312] | 99 | </fileset>
|
---|
| 100 | <fileset refid="plugin.requires.jars"/>
|
---|
[34409] | 101 | <fileset refid="jaxb.jars"/>
|
---|
[32312] | 102 | </path>
|
---|
[34620] | 103 | <path id="processor.path">
|
---|
| 104 | <pathelement location="${error_prone_core.jar}"/>
|
---|
[34889] | 105 | <pathelement location="${dataflow.jar}"/>
|
---|
| 106 | <pathelement location="${javacutil.jar}"/>
|
---|
[34887] | 107 | <pathelement location="${failureaccess.jar}"/>
|
---|
| 108 | <pathelement location="${jformatstring.jar}"/>
|
---|
[35342] | 109 | <pathelement location="${auto-value-annotations.jar}"/>
|
---|
[34620] | 110 | </path>
|
---|
[32312] | 111 |
|
---|
[26341] | 112 | <!--
|
---|
| 113 | **********************************************************
|
---|
| 114 | ** init - initializes the build
|
---|
| 115 | **********************************************************
|
---|
| 116 | -->
|
---|
| 117 | <target name="init">
|
---|
| 118 | <mkdir dir="${plugin.build.dir}"/>
|
---|
| 119 | </target>
|
---|
| 120 | <!--
|
---|
| 121 | **********************************************************
|
---|
[29442] | 122 | ** compile - compiles the source tree
|
---|
[26341] | 123 | **********************************************************
|
---|
| 124 | -->
|
---|
[32322] | 125 | <target name="pre-compile">
|
---|
[35387] | 126 | <!-- to be overridden by plugins that need to perform additional tasks before compiling -->
|
---|
[32322] | 127 | </target>
|
---|
| 128 | <target name="compile" depends="init, pre-compile" unless="skip-compile">
|
---|
[28290] | 129 | <echo message="compiling sources for ${plugin.jar} ..."/>
|
---|
[34620] | 130 | <javac srcdir="${plugin.src.dir}" debug="true" destdir="${plugin.build.dir}" includeantruntime="false"
|
---|
| 131 | encoding="UTF-8" target="${java.lang.version}" source="${java.lang.version}" fork="yes">
|
---|
[35010] | 132 | <compilerarg value="-J-Xbootclasspath/p:${toString:jdk8.boot.classpath}" unless:set="isJava9"/>
|
---|
[34620] | 133 | <compilerarg line="-XDcompilePolicy=simple"/>
|
---|
| 134 | <compilerarg value="-processorpath"/>
|
---|
| 135 | <compilerarg pathref="processor.path"/>
|
---|
[26341] | 136 | <compilerarg value="-Xlint:deprecation"/>
|
---|
| 137 | <compilerarg value="-Xlint:unchecked"/>
|
---|
[34890] | 138 | <compilerarg value="-Xplugin:ErrorProne -Xep:StringSplitter:OFF -Xep:ReferenceEquality:OFF -Xep:InsecureCryptoUsage:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:JdkObsolete:OFF -Xep:EqualsHashCode:OFF"/>
|
---|
[32737] | 139 | <compilerarg line="-Xmaxwarns 1000"/>
|
---|
[32312] | 140 | <classpath refid="plugin.classpath"/>
|
---|
[26341] | 141 | </javac>
|
---|
| 142 | </target>
|
---|
| 143 | <!--
|
---|
| 144 | **********************************************************
|
---|
[29005] | 145 | ** setup-dist - copies files for distribution
|
---|
[28990] | 146 | **********************************************************
|
---|
| 147 | -->
|
---|
[29005] | 148 | <target name="setup-dist-default">
|
---|
[28990] | 149 | <copy todir="${plugin.build.dir}/resources" failonerror="no" includeemptydirs="no">
|
---|
[34677] | 150 | <fileset dir="${plugin.resources.dir}"/>
|
---|
[28990] | 151 | </copy>
|
---|
| 152 | <copy todir="${plugin.build.dir}/images" failonerror="no" includeemptydirs="no">
|
---|
| 153 | <fileset dir="images"/>
|
---|
| 154 | </copy>
|
---|
| 155 | <copy todir="${plugin.build.dir}/data" failonerror="no" includeemptydirs="no">
|
---|
| 156 | <fileset dir="data"/>
|
---|
| 157 | </copy>
|
---|
| 158 | <copy todir="${plugin.build.dir}">
|
---|
| 159 | <fileset dir=".">
|
---|
| 160 | <include name="README"/>
|
---|
[28996] | 161 | <include name="LICENSE*"/>
|
---|
| 162 | <include name="*GPL*"/>
|
---|
[34323] | 163 | <exclude name="*.md"/>
|
---|
[28990] | 164 | </fileset>
|
---|
| 165 | </copy>
|
---|
[29005] | 166 | </target>
|
---|
| 167 | <target name="setup-dist">
|
---|
[29007] | 168 | <antcall target="setup-dist-default" />
|
---|
[29005] | 169 | </target>
|
---|
| 170 | <!--
|
---|
| 171 | **********************************************************
|
---|
[34244] | 172 | ** dist - creates the plugin jars
|
---|
[29005] | 173 | **********************************************************
|
---|
| 174 | -->
|
---|
[34244] | 175 | <target name="dist" depends="compile,javadoc,revision" unless="skip-dist">
|
---|
[29005] | 176 | <echo message="creating ${ant.project.name}.jar ... "/>
|
---|
[29007] | 177 | <antcall target="setup-dist" />
|
---|
[34703] | 178 | <delete failonerror="no">
|
---|
| 179 | <fileset dir="." includes="${manifest}*" />
|
---|
| 180 | </delete>
|
---|
| 181 | <manifest file="${manifest}" mode="update">
|
---|
[28990] | 182 | <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
|
---|
| 183 | <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
|
---|
| 184 | <attribute name="Plugin-Class" value="${plugin.class}" />
|
---|
| 185 | <attribute name="Plugin-Description" value="${plugin.description}" />
|
---|
| 186 | <attribute name="Plugin-Date" value="${version.entry.commit.date}" />
|
---|
| 187 | <attribute name="Author" value="${plugin.author}"/>
|
---|
| 188 | </manifest>
|
---|
| 189 | <antcall target="add-manifest-attribute">
|
---|
| 190 | <param name="manifest.attribute" value="Plugin-Link"/>
|
---|
[30562] | 191 | <param name="property.name" value="plugin.link"/>
|
---|
| 192 | <param name="property.value" value="${plugin.link}"/>
|
---|
[28990] | 193 | </antcall>
|
---|
| 194 | <antcall target="add-manifest-attribute">
|
---|
| 195 | <param name="manifest.attribute" value="Plugin-Icon"/>
|
---|
[30562] | 196 | <param name="property.name" value="plugin.icon"/>
|
---|
| 197 | <param name="property.value" value="${plugin.icon}"/>
|
---|
[28990] | 198 | </antcall>
|
---|
| 199 | <antcall target="add-manifest-attribute">
|
---|
| 200 | <param name="manifest.attribute" value="Plugin-Early"/>
|
---|
[30562] | 201 | <param name="property.name" value="plugin.early"/>
|
---|
| 202 | <param name="property.value" value="${plugin.early}"/>
|
---|
[28990] | 203 | </antcall>
|
---|
| 204 | <antcall target="add-manifest-attribute">
|
---|
[34705] | 205 | <param name="manifest.attribute" value="Plugin-Provides"/>
|
---|
| 206 | <param name="property.name" value="plugin.provides"/>
|
---|
| 207 | <param name="property.value" value="${plugin.provides}"/>
|
---|
| 208 | </antcall>
|
---|
| 209 | <antcall target="add-manifest-attribute">
|
---|
[28990] | 210 | <param name="manifest.attribute" value="Plugin-Requires"/>
|
---|
[30562] | 211 | <param name="property.name" value="plugin.requires"/>
|
---|
| 212 | <param name="property.value" value="${plugin.requires}"/>
|
---|
[28990] | 213 | </antcall>
|
---|
| 214 | <antcall target="add-manifest-attribute">
|
---|
| 215 | <param name="manifest.attribute" value="Plugin-Stage"/>
|
---|
[30562] | 216 | <param name="property.name" value="plugin.stage"/>
|
---|
| 217 | <param name="property.value" value="${plugin.stage}"/>
|
---|
[28990] | 218 | </antcall>
|
---|
[30952] | 219 | <antcall target="add-manifest-attribute">
|
---|
| 220 | <param name="manifest.attribute" value="Plugin-Canloadatruntime"/>
|
---|
| 221 | <param name="property.name" value="plugin.canloadatruntime"/>
|
---|
| 222 | <param name="property.value" value="${plugin.canloadatruntime}"/>
|
---|
| 223 | </antcall>
|
---|
[34604] | 224 | <antcall target="add-manifest-attribute">
|
---|
| 225 | <param name="manifest.attribute" value="Plugin-Minimum-Java-Version"/>
|
---|
| 226 | <param name="property.name" value="plugin.minimum.java.version"/>
|
---|
| 227 | <param name="property.value" value="${plugin.minimum.java.version}"/>
|
---|
| 228 | </antcall>
|
---|
[29435] | 229 | <antcall target="additional-manifest" />
|
---|
[34651] | 230 | <antcall target="build-jar" />
|
---|
| 231 | <jar destfile="${plugin.sources.jar}" basedir="${plugin.src.dir}" level="9"/>
|
---|
| 232 | <jar destfile="${plugin.javadoc.jar}" basedir="${plugin.doc.dir}" level="9"/>
|
---|
[34703] | 233 | <delete failonerror="no">
|
---|
| 234 | <fileset dir="." includes="${manifest}*" />
|
---|
| 235 | </delete>
|
---|
[34651] | 236 | <antcall target="post-dist" />
|
---|
| 237 | </target>
|
---|
| 238 | <target name="build-jar">
|
---|
[34703] | 239 | <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}" manifest="${manifest}" manifestencoding="UTF-8" duplicate="preserve" level="9">
|
---|
[31281] | 240 | <restrict>
|
---|
| 241 | <not><or>
|
---|
| 242 | <name name="META-INF/maven/*"/>
|
---|
| 243 | <name name="META-INF/DEPENDENCIES"/>
|
---|
| 244 | <name name="META-INF/LICENSE"/>
|
---|
| 245 | <name name="META-INF/NOTICE"/>
|
---|
[32175] | 246 | <name name="META-INF/*.RSA"/>
|
---|
| 247 | <name name="META-INF/*.SF"/>
|
---|
[34604] | 248 | <name name="module-info.class"/>
|
---|
[31281] | 249 | </or></not>
|
---|
| 250 | <archives>
|
---|
| 251 | <zips>
|
---|
| 252 | <fileset dir="${plugin.lib.dir}" includes="*.jar" excludes="*-sources.jar, *-javadoc.jar" erroronmissingdir="no"/>
|
---|
| 253 | </zips>
|
---|
| 254 | </archives>
|
---|
| 255 | </restrict>
|
---|
[28990] | 256 | </jar>
|
---|
| 257 | </target>
|
---|
[29007] | 258 | <target name="post-dist">
|
---|
[35387] | 259 | <!-- to be overridden by plugins that need to perform additional tasks on resulting jar -->
|
---|
[29007] | 260 | </target>
|
---|
[30562] | 261 | <target name="add-manifest-attribute" depends="check-manifest-attribute" if="have-${property.name}">
|
---|
[34703] | 262 | <manifest file="${manifest}" mode="update">
|
---|
[30562] | 263 | <attribute name="${manifest.attribute}" value="${property.value}" />
|
---|
[28990] | 264 | </manifest>
|
---|
| 265 | </target>
|
---|
[29435] | 266 | <!-- target to add additional entries, empty in commons -->
|
---|
| 267 | <target name="additional-manifest">
|
---|
| 268 | </target>
|
---|
[28990] | 269 | <target name="check-manifest-attribute">
|
---|
[30562] | 270 | <condition property="have-${property.name}">
|
---|
[28990] | 271 | <and>
|
---|
[30562] | 272 | <isset property="${property.name}"/>
|
---|
[28990] | 273 | <not>
|
---|
[30562] | 274 | <equals arg1="${property.value}" arg2=""/>
|
---|
[28990] | 275 | </not>
|
---|
| 276 | <not>
|
---|
[30562] | 277 | <equals arg1="${property.value}" arg2="..."/>
|
---|
[28990] | 278 | </not>
|
---|
| 279 | </and>
|
---|
| 280 | </condition>
|
---|
| 281 | </target>
|
---|
[35340] | 282 | <target name="pre-javadoc">
|
---|
[35387] | 283 | <!-- to be overridden by plugins that need to perform additional tasks before generating javadoc -->
|
---|
[35340] | 284 | </target>
|
---|
| 285 | <target name="javadoc" depends="pre-javadoc" unless="skip-javadoc">
|
---|
[34045] | 286 | <javadoc destdir="${plugin.doc.dir}"
|
---|
[34873] | 287 | executable="${javadoc.executable}"
|
---|
[34038] | 288 | encoding="UTF-8"
|
---|
| 289 | windowtitle="JOSM-${ant.project.name}"
|
---|
| 290 | use="true"
|
---|
| 291 | private="true"
|
---|
| 292 | linksource="true"
|
---|
| 293 | author="false">
|
---|
| 294 | <classpath refid="plugin.classpath"/>
|
---|
[34383] | 295 | <sourcepath>
|
---|
[34387] | 296 | <pathelement path="${plugin.src.dir}" />
|
---|
[34383] | 297 | <pathelement path="gen" />
|
---|
| 298 | <pathelement path="includes" />
|
---|
| 299 | </sourcepath>
|
---|
[34874] | 300 | <link href="${javadoc.link}"/>
|
---|
[34038] | 301 | <link href="https://josm.openstreetmap.de/doc"/>
|
---|
| 302 | <doctitle><![CDATA[<h2>JOSM-${ant.project.name} - Javadoc</h2>]]></doctitle>
|
---|
| 303 | <bottom><![CDATA[<a href="https://josm.openstreetmap.de/wiki/Plugins">JOSM Plugins</a>]]></bottom>
|
---|
[34595] | 304 | <arg line="-tag license:X" />
|
---|
[34362] | 305 | <arg value="-html5" if:set="isJava9" />
|
---|
[34366] | 306 | <arg value="--add-modules" if:set="isJava9" unless:set="isJava11" />
|
---|
| 307 | <arg value="java.activation,java.se.ee" if:set="isJava9" unless:set="isJava11" />
|
---|
[34363] | 308 | <arg value="--add-exports" if:set="isJava9" unless:set="noJavaFX" />
|
---|
| 309 | <arg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" if:set="isJava9" unless:set="noJavaFX" />
|
---|
[34038] | 310 | </javadoc>
|
---|
| 311 | </target>
|
---|
[28990] | 312 | <!--
|
---|
| 313 | **********************************************************
|
---|
[26341] | 314 | ** revision - extracts the current revision number for the
|
---|
| 315 | ** file build.number and stores it in the XML property
|
---|
| 316 | ** version.*
|
---|
| 317 | **********************************************************
|
---|
| 318 | -->
|
---|
[30161] | 319 | <!--
|
---|
| 320 | ** Initializes the REVISION.XML file from SVN information
|
---|
| 321 | -->
|
---|
[32334] | 322 | <target name="init-svn-revision-xml" unless="skip-revision">
|
---|
[30161] | 323 | <exec append="false" output="REVISION.XML" executable="svn" failifexecutionfails="false" resultproperty="svn.info.result">
|
---|
[26341] | 324 | <env key="LANG" value="C"/>
|
---|
| 325 | <arg value="info"/>
|
---|
| 326 | <arg value="--xml"/>
|
---|
| 327 | <arg value="."/>
|
---|
| 328 | </exec>
|
---|
[32334] | 329 | <condition property="svn.info.fail">
|
---|
[33489] | 330 | <not>
|
---|
| 331 | <and>
|
---|
| 332 | <equals arg1="${svn.info.result}" arg2="0" />
|
---|
| 333 | <length file="REVISION.XML" when="greater" length="1" />
|
---|
| 334 | </and>
|
---|
| 335 | </not>
|
---|
[30161] | 336 | </condition>
|
---|
[26341] | 337 | </target>
|
---|
| 338 | <!--
|
---|
[30306] | 339 | ** Initializes the REVISION.XML file from git-svn information.
|
---|
| 340 | Obtains the revision from the git-svn-id field.
|
---|
[30161] | 341 | -->
|
---|
[32334] | 342 | <target name="init-git-svn-revision-xml" if="svn.info.fail" unless="skip-revision">
|
---|
[30306] | 343 | <exec append="false" output="REVISION.XML" executable="git" failifexecutionfails="false" resultproperty="git.svn.info.result">
|
---|
[30161] | 344 | <arg value="log"/>
|
---|
| 345 | <arg value="-1"/>
|
---|
| 346 | <arg value="--grep=git-svn-id"/>
|
---|
| 347 | <!--
|
---|
| 348 | %B: raw body (unwrapped subject and body)
|
---|
| 349 | %n: new line
|
---|
| 350 | %ai: author date, ISO 8601 format
|
---|
| 351 | -->
|
---|
| 352 | <arg value="--pretty=format:%B%n%ai"/>
|
---|
[31886] | 353 | <arg value="."/>
|
---|
[30161] | 354 | </exec>
|
---|
| 355 | <replaceregexp file="REVISION.XML" flags="s"
|
---|
| 356 | match=".*git-svn-id: [^@]*@([0-9]+).*(\d{4}-\d{2}-\d{2}.\d{2}\:\d{2}\:\d{2}\s*[+-]\d{2}:?\d{2})\s*$"
|
---|
| 357 | replace="<info><entry><commit revision="\1"><date>\2</date></commit></entry></info>"/>
|
---|
[30306] | 358 | <condition property="git.svn.fail">
|
---|
| 359 | <not>
|
---|
| 360 | <and>
|
---|
| 361 | <equals arg1="${git.svn.info.result}" arg2="0" />
|
---|
| 362 | <length file="REVISION.XML" when="greater" length="1" />
|
---|
| 363 | </and>
|
---|
| 364 | </not>
|
---|
| 365 | </condition>
|
---|
[30562] | 366 | </target>
|
---|
[30306] | 367 | <!--
|
---|
| 368 | ** Initializes the REVISION.XML file from git (w/o svn) information.
|
---|
| 369 | Uses Unix date as revision number.
|
---|
| 370 | -->
|
---|
[32334] | 371 | <target name="init-git-revision-xml" if="git.svn.fail" unless="skip-revision">
|
---|
[30309] | 372 | <exec append="false" output="REVISION.XML" executable="git" failifexecutionfails="false" resultproperty="git.info.result">
|
---|
[30306] | 373 | <arg value="log"/>
|
---|
| 374 | <arg value="-1"/>
|
---|
| 375 | <arg value="--pretty=format:%at%n%ai"/>
|
---|
[31886] | 376 | <arg value="."/>
|
---|
[30306] | 377 | </exec>
|
---|
| 378 | <replaceregexp file="REVISION.XML" flags="s"
|
---|
| 379 | match="\s*(\d*)\s+(\d{4}-\d{2}-\d{2}.\d{2}\:\d{2}\:\d{2}\s*[+-]\d{2}:?\d{2})\s*$"
|
---|
| 380 | replace="<info><entry><commit revision="\1"><date>\2</date></commit></entry></info>"/>
|
---|
[30309] | 381 | <condition property="git.fail">
|
---|
| 382 | <not>
|
---|
| 383 | <and>
|
---|
| 384 | <equals arg1="${git.info.result}" arg2="0" />
|
---|
| 385 | <length file="REVISION.XML" when="greater" length="1" />
|
---|
| 386 | </and>
|
---|
| 387 | </not>
|
---|
| 388 | </condition>
|
---|
[30161] | 389 | </target>
|
---|
[32334] | 390 | <target name="init-revision-fallback" if="git.fail" unless="skip-revision">
|
---|
[30309] | 391 | <tstamp>
|
---|
| 392 | <format property="current.time" pattern="yyyy-MM-dd'T'HH:mm:ss.SSS" />
|
---|
| 393 | </tstamp>
|
---|
| 394 | <echo file="REVISION.XML"><![CDATA[<info><entry><commit revision="UNKNOWN"><date>${current.time}</date></commit></entry></info>]]></echo>
|
---|
| 395 | </target>
|
---|
[32311] | 396 | <target name="revision" depends="init-svn-revision-xml, init-git-svn-revision-xml, init-git-revision-xml, init-revision-fallback" unless="skip-revision">
|
---|
[30161] | 397 | <xmlproperty file="REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
| 398 | <delete file="REVISION.XML"/>
|
---|
| 399 | </target>
|
---|
| 400 | <!--
|
---|
[26341] | 401 | **********************************************************
|
---|
| 402 | ** clean - clean up the build environment
|
---|
| 403 | **********************************************************
|
---|
| 404 | -->
|
---|
| 405 | <target name="clean">
|
---|
| 406 | <delete dir="${plugin.build.dir}"/>
|
---|
[34045] | 407 | <delete dir="${plugin.doc.dir}"/>
|
---|
[33491] | 408 | <delete dir="${checkstyle-build.dir}"/>
|
---|
[26341] | 409 | <delete file="${plugin.jar}"/>
|
---|
[34244] | 410 | <delete file="${plugin.sources.jar}"/>
|
---|
| 411 | <delete file="${plugin.javadoc.jar}"/>
|
---|
[26341] | 412 | </target>
|
---|
| 413 | <!--
|
---|
| 414 | **********************************************************
|
---|
| 415 | ** install - install the plugin in your local JOSM installation
|
---|
| 416 | **********************************************************
|
---|
| 417 | -->
|
---|
| 418 | <target name="install" depends="dist">
|
---|
| 419 | <property environment="env"/>
|
---|
[30907] | 420 | <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins">
|
---|
[26341] | 421 | <and>
|
---|
| 422 | <os family="windows"/>
|
---|
| 423 | </and>
|
---|
| 424 | </condition>
|
---|
[30896] | 425 | <condition property="josm.plugins.dir" value="${user.home}/Library/JOSM/plugins">
|
---|
| 426 | <and>
|
---|
| 427 | <os family="mac"/>
|
---|
| 428 | </and>
|
---|
| 429 | </condition>
|
---|
| 430 | <condition property="josm.plugins.dir" value="${user.home}/.josm/plugins">
|
---|
| 431 | <and>
|
---|
| 432 | <not><os family="windows"/></not>
|
---|
| 433 | <not><os family="mac"/></not>
|
---|
| 434 | </and>
|
---|
| 435 | </condition>
|
---|
[26341] | 436 | <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
|
---|
| 437 | </target>
|
---|
| 438 | <!--
|
---|
[32052] | 439 | ************************** Publishing the plugin ***********************************
|
---|
[26341] | 440 | -->
|
---|
| 441 | <!--
|
---|
[32052] | 442 | ** extracts the JOSM release for the JOSM version in ../core and saves it in the
|
---|
[26341] | 443 | ** property ${coreversion.info.entry.revision}
|
---|
| 444 | **
|
---|
| 445 | -->
|
---|
| 446 | <target name="core-info">
|
---|
| 447 | <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
|
---|
| 448 | <env key="LANG" value="C"/>
|
---|
| 449 | <arg value="info"/>
|
---|
| 450 | <arg value="--xml"/>
|
---|
| 451 | <arg value="../../core"/>
|
---|
| 452 | </exec>
|
---|
| 453 | <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
|
---|
| 454 | <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
|
---|
| 455 | <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
|
---|
| 456 | <delete file="core.info.xml"/>
|
---|
| 457 | </target>
|
---|
| 458 | <!--
|
---|
| 459 | ** commits the source tree for this plugin
|
---|
| 460 | -->
|
---|
| 461 | <target name="commit-current">
|
---|
| 462 | <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
|
---|
| 463 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
| 464 | <env key="LANG" value="C"/>
|
---|
| 465 | <arg value="commit"/>
|
---|
[28400] | 466 | <arg value="-m"/>
|
---|
| 467 | <arg value="${commit.message}"/>
|
---|
[26341] | 468 | <arg value="."/>
|
---|
| 469 | </exec>
|
---|
| 470 | </target>
|
---|
| 471 | <!--
|
---|
| 472 | ** updates (svn up) the source tree for this plugin
|
---|
| 473 | -->
|
---|
| 474 | <target name="update-current">
|
---|
| 475 | <echo>Updating plugin source ...</echo>
|
---|
| 476 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
| 477 | <env key="LANG" value="C"/>
|
---|
| 478 | <arg value="up"/>
|
---|
| 479 | <arg value="."/>
|
---|
| 480 | </exec>
|
---|
| 481 | <echo>Updating ${plugin.jar} ...</echo>
|
---|
| 482 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
| 483 | <env key="LANG" value="C"/>
|
---|
| 484 | <arg value="up"/>
|
---|
[34224] | 485 | <arg value="${plugin.jar}"/>
|
---|
[26341] | 486 | </exec>
|
---|
| 487 | </target>
|
---|
| 488 | <!--
|
---|
[32052] | 489 | ** commits the plugin.jar
|
---|
[26341] | 490 | -->
|
---|
| 491 | <target name="commit-dist">
|
---|
| 492 | <echo>
|
---|
| 493 | ***** Properties of published ${plugin.jar} *****
|
---|
[27960] | 494 | Commit message : '${commit.message}'
|
---|
[26341] | 495 | Plugin-Mainversion: ${plugin.main.version}
|
---|
| 496 | JOSM build version: ${coreversion.info.entry.revision}
|
---|
| 497 | Plugin-Version : ${version.entry.commit.revision}
|
---|
[27960] | 498 | ***** / Properties of published ${plugin.jar} *****
|
---|
| 499 |
|
---|
[35386] | 500 | Now committing ${plugin.jar} ...
|
---|
[26341] | 501 | </echo>
|
---|
| 502 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
|
---|
| 503 | <env key="LANG" value="C"/>
|
---|
[28400] | 504 | <arg value="-m"/>
|
---|
| 505 | <arg value="${commit.message}"/>
|
---|
[26341] | 506 | <arg value="commit"/>
|
---|
| 507 | <arg value="${plugin.jar}"/>
|
---|
| 508 | </exec>
|
---|
| 509 | </target>
|
---|
| 510 | <!-- ** make sure svn is present as a command line tool ** -->
|
---|
| 511 | <target name="ensure-svn-present">
|
---|
| 512 | <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
|
---|
| 513 | <env key="LANG" value="C"/>
|
---|
| 514 | <arg value="--version"/>
|
---|
| 515 | </exec>
|
---|
| 516 | <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
|
---|
| 517 | <!-- return code not set at all? Most likely svn isn't installed -->
|
---|
| 518 | <condition>
|
---|
| 519 | <not>
|
---|
| 520 | <isset property="svn.exit.code"/>
|
---|
| 521 | </not>
|
---|
| 522 | </condition>
|
---|
| 523 | </fail>
|
---|
| 524 | <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
|
---|
| 525 | <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
|
---|
| 526 | <condition>
|
---|
| 527 | <isfailure code="${svn.exit.code}"/>
|
---|
| 528 | </condition>
|
---|
| 529 | </fail>
|
---|
| 530 | </target>
|
---|
[28807] | 531 |
|
---|
[26341] | 532 | <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
|
---|
| 533 | </target>
|
---|
[31281] | 534 |
|
---|
[30550] | 535 | <macrodef name="init-test-preferences">
|
---|
| 536 | <sequential>
|
---|
[32326] | 537 | <copy file="../00_core_test_config/preferences.template.xml" tofile="../00_core_test_config/unit-josm.home/preferences.xml"/>
|
---|
| 538 | <replace file="../00_core_test_config/unit-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/>
|
---|
| 539 | <replace file="../00_core_test_config/unit-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/>
|
---|
[30550] | 540 | </sequential>
|
---|
| 541 | </macrodef>
|
---|
[32306] | 542 | <target name="check-test">
|
---|
| 543 | <available file="${plugin.test.dir}" type="dir" property="test.present"/>
|
---|
| 544 | </target>
|
---|
[35443] | 545 | <target name="test-init" depends="check-test" if="test.present" unless="skip-test">
|
---|
[30550] | 546 | <mkdir dir="${plugin.test.dir}/build"/>
|
---|
| 547 | <mkdir dir="${plugin.test.dir}/build/unit"/>
|
---|
| 548 | <mkdir dir="${plugin.test.dir}/report"/>
|
---|
[30562] | 549 | <init-test-preferences/>
|
---|
[35413] | 550 | <ivy:settings file="${josm.ivysettings}" id="ivy.core.settings"/>
|
---|
| 551 | <ivy:retrieve file="${josm.ivy}" settingsRef="ivy.core.settings" pattern="../00_core_test_lib/[artifact].[ext]" conf="test"/>
|
---|
[35411] | 552 | <path id="test.classpath">
|
---|
| 553 | <!-- JMockit must be included before JUnit in the classpath -->
|
---|
| 554 | <pathelement path="${jmockit.jar}"/>
|
---|
| 555 | <fileset dir="../00_core_test_lib">
|
---|
| 556 | <include name="**/*.jar"/>
|
---|
| 557 | <exclude name="**/jmockit*.jar"/>
|
---|
| 558 | </fileset>
|
---|
| 559 | <fileset dir="${plugin.test.dir}/lib" erroronmissingdir="no">
|
---|
| 560 | <include name="**/*.jar"/>
|
---|
| 561 | <exclude name="**/*-sources.jar"/>
|
---|
| 562 | <exclude name="**/*-javadoc.jar"/>
|
---|
| 563 | </fileset>
|
---|
| 564 | <fileset dir="lib" erroronmissingdir="no">
|
---|
| 565 | <include name="**/*.jar"/>
|
---|
| 566 | <exclude name="**/*-sources.jar"/>
|
---|
| 567 | <exclude name="**/*-javadoc.jar"/>
|
---|
| 568 | </fileset>
|
---|
| 569 | <pathelement path="${plugin.resources.dir}"/>
|
---|
| 570 | <pathelement path="${plugin.test.dir}/data"/>
|
---|
| 571 | <pathelement path="${josm.test.build.dir}/unit"/>
|
---|
| 572 | <pathelement path="${josm}"/>
|
---|
| 573 | <pathelement path="${plugin.jar}"/>
|
---|
| 574 | <pathelement path="${annotations.jar}"/>
|
---|
| 575 | </path>
|
---|
[30550] | 576 | </target>
|
---|
| 577 | <target name="test-clean">
|
---|
| 578 | <delete dir="${plugin.test.dir}/build"/>
|
---|
| 579 | <delete dir="${plugin.test.dir}/report"/>
|
---|
| 580 | <delete file="${plugin.test.dir}/jacoco.exec" />
|
---|
[32326] | 581 | <delete file="../00_core_test_config/unit-josm.home/preferences.xml" />
|
---|
| 582 | <delete dir="../00_core_test_config/unit-josm.home/cache" failonerror="false"/>
|
---|
[30550] | 583 | </target>
|
---|
[35443] | 584 | <target name="test-compile" depends="test-init,dist" if="test.present" unless="skip-test">
|
---|
[30550] | 585 | <sequential>
|
---|
[34364] | 586 | <javac debug="on" includeantruntime="false" srcdir="${plugin.test.dir}/unit" destdir="${plugin.test.dir}/build/unit" encoding="UTF-8"
|
---|
[34373] | 587 | target="${java.lang.version}" source="${java.lang.version}">
|
---|
[30550] | 588 | <classpath>
|
---|
[30747] | 589 | <fileset refid="plugin.requires.jars"/>
|
---|
[30562] | 590 | <path refid="test.classpath"/>
|
---|
[30550] | 591 | </classpath>
|
---|
[34703] | 592 | <compilerarg value="-Xlint:all"/>
|
---|
| 593 | <compilerarg value="-Xlint:-serial"/>
|
---|
[32926] | 594 | </javac>
|
---|
[30550] | 595 | </sequential>
|
---|
| 596 | </target>
|
---|
[35443] | 597 | <target name="test" depends="dist, test-clean, test-compile" if="test.present" unless="skip-test"
|
---|
[30747] | 598 | description="Run unit tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
|
---|
[35411] | 599 | <ivy:retrieve file="${josm.ivy}" pattern="../00_core_tools/[conf].[ext]" conf="jacocoant"/>
|
---|
[30747] | 600 | <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="../00_core_tools/jacocoant.jar" />
|
---|
[30550] | 601 | <sequential>
|
---|
[30562] | 602 | <echo message="Running unit tests with JUnit"/>
|
---|
[34363] | 603 | <jacoco:coverage destfile="${plugin.test.dir}/jacoco.exec" enabled="${coverageByDefault}">
|
---|
[30556] | 604 | <junit printsummary="yes" fork="true" forkmode="once" dir="${basedir}">
|
---|
[30562] | 605 | <jvmarg value="-Dfile.encoding=UTF-8"/>
|
---|
[34598] | 606 | <jvmarg value="-javaagent:${jmockit.jar}"/>
|
---|
[34367] | 607 | <jvmarg value="--add-modules" if:set="isJava9" unless:set="isJava11" />
|
---|
| 608 | <jvmarg value="java.activation,java.se.ee" if:set="isJava9" unless:set="isJava11" />
|
---|
[33331] | 609 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 610 | <jvmarg value="java.base/java.lang.reflect=ALL-UNNAMED" if:set="isJava9" />
|
---|
[33339] | 611 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 612 | <jvmarg value="java.desktop/javax.imageio.spi=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 613 | <jvmarg value="--add-exports" if:set="isJava9" />
|
---|
| 614 | <jvmarg value="java.desktop/com.sun.imageio.spi=ALL-UNNAMED" if:set="isJava9" />
|
---|
[32326] | 615 | <sysproperty key="josm.home" value="../00_core_test_config/unit-josm.home"/>
|
---|
[30550] | 616 | <sysproperty key="josm.test.data" value="${plugin.test.dir}/data"/>
|
---|
| 617 | <sysproperty key="java.awt.headless" value="true"/>
|
---|
| 618 | <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
|
---|
| 619 | <classpath>
|
---|
[30747] | 620 | <fileset refid="plugin.requires.jars"/>
|
---|
[30550] | 621 | <path refid="test.classpath"/>
|
---|
| 622 | <pathelement path="${plugin.test.dir}/build/unit"/>
|
---|
| 623 | </classpath>
|
---|
| 624 | <formatter type="plain"/>
|
---|
| 625 | <formatter type="xml"/>
|
---|
| 626 | <batchtest fork="yes" todir="${plugin.test.dir}/report">
|
---|
[30562] | 627 | <fileset dir="${plugin.test.dir}/build/unit" includes="**/*Test.class"/>
|
---|
[30550] | 628 | </batchtest>
|
---|
| 629 | </junit>
|
---|
| 630 | </jacoco:coverage>
|
---|
| 631 | </sequential>
|
---|
[30562] | 632 | </target>
|
---|
[31281] | 633 |
|
---|
[35389] | 634 | <target name="checkstyle-compile" depends="resolve-tools">
|
---|
[33491] | 635 | <mkdir dir="${checkstyle-build.dir}"/>
|
---|
| 636 | <javac sourcepath="" srcdir="../00_core_tools/checkstyle/src" failonerror="true"
|
---|
[34364] | 637 | destdir="${checkstyle-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on"
|
---|
[33491] | 638 | includeantruntime="false" createMissingPackageInfoClass="false"
|
---|
[35379] | 639 | encoding="UTF-8" classpathref="checkstyle.classpath">
|
---|
[33491] | 640 | </javac>
|
---|
| 641 | </target>
|
---|
| 642 | <target name="checkstyle" depends="checkstyle-compile">
|
---|
[35379] | 643 | <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties">
|
---|
| 644 | <classpath refid="checkstyle.classpath"/>
|
---|
| 645 | <classpath path="${checkstyle-build.dir}"/>
|
---|
| 646 | </taskdef>
|
---|
[34378] | 647 | <checkstyle config="${basedir}/../checkstyle-config.xml">
|
---|
[33061] | 648 | <fileset dir="${basedir}/src" includes="**/*.java" excludes="boofcv/**/*.java,
|
---|
| 649 | com/google/**/*.java,
|
---|
[32317] | 650 | crosby/**/*.java,
|
---|
| 651 | edu/princeton/**/*.java,
|
---|
| 652 | net/boplicity/**/*.java,
|
---|
| 653 | org/apache/**/*.java,
|
---|
| 654 | org/dinopolis/**/*.java,
|
---|
| 655 | org/kaintoch/**/*.java,
|
---|
| 656 | org/marvinproject/**/*.java,
|
---|
| 657 | org/netbeans/**/*.java,
|
---|
[34703] | 658 | org/openstreetmap/josm/plugins/dataimport/io/tcx/**/*.java,
|
---|
| 659 | org/openstreetmap/josm/plugins/ohe/parser/**/*.java,
|
---|
| 660 | org/openstreetmap/josm/plugins/pdfimport/pdfbox/operators/**/*.java
|
---|
| 661 | org/openstreetmap/josm/plugins/roadsigns/javacc/**/*.java,
|
---|
[32765] | 662 | org/osgeo/**/*.java,
|
---|
[34703] | 663 | "/>
|
---|
[32310] | 664 | <fileset dir="${basedir}/test" includes="**/*.java" erroronmissingdir="false"/>
|
---|
| 665 | <formatter type="xml" toFile="checkstyle-josm-${ant.project.name}.xml"/>
|
---|
| 666 | </checkstyle>
|
---|
| 667 | </target>
|
---|
| 668 |
|
---|
[35389] | 669 | <target name="spotbugs" depends="compile,resolve-tools">
|
---|
[35377] | 670 | <taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${toString:spotbugs.classpath}"/>
|
---|
[33591] | 671 | <spotbugs output="xml"
|
---|
| 672 | outputFile="spotbugs-josm-${ant.project.name}.xml"
|
---|
[35377] | 673 | classpath="${toString:spotbugs.classpath}"
|
---|
[32310] | 674 | pluginList=""
|
---|
[33591] | 675 | excludeFilter="../spotbugs-filter.xml"
|
---|
[34039] | 676 | effort="less"
|
---|
[32310] | 677 | reportLevel="low"
|
---|
[34463] | 678 | nested="false"
|
---|
[34462] | 679 | jvmargs="-Xmx1024m"
|
---|
[32310] | 680 | >
|
---|
[32317] | 681 | <auxClasspath refid="plugin.classpath" />
|
---|
[32310] | 682 | <sourcePath path="${basedir}/src" />
|
---|
[33932] | 683 | <class location="${plugin.build.dir}" />
|
---|
[33591] | 684 | </spotbugs>
|
---|
[32310] | 685 | </target>
|
---|
| 686 |
|
---|
[28807] | 687 | <target name="runjosm" depends="install">
|
---|
[32311] | 688 | <java jar="${josm}" fork="true"/>
|
---|
[28807] | 689 | </target>
|
---|
| 690 |
|
---|
| 691 | <target name="profilejosm" depends="install">
|
---|
| 692 | <nbprofiledirect>
|
---|
| 693 | </nbprofiledirect>
|
---|
| 694 | <java jar="${josm}" fork="true">
|
---|
| 695 | <jvmarg value="${profiler.info.jvmargs.agent}"/>
|
---|
| 696 | </java>
|
---|
| 697 | </target>
|
---|
[29004] | 698 | <!--
|
---|
[32052] | 699 | ** shows a help text
|
---|
[29004] | 700 | -->
|
---|
| 701 | <target name="help">
|
---|
| 702 | <echo>
|
---|
| 703 | You can use following targets:
|
---|
| 704 | * dist This default target builds the plugin jar file
|
---|
[35387] | 705 | * clean Cleanup automatically created files
|
---|
[31281] | 706 | * test Run unit tests (if any)
|
---|
[29004] | 707 | * publish Checkin source code, build jar and checkin plugin jar
|
---|
| 708 | (requires proper entry for SVN commit message!)
|
---|
| 709 | * install Install the plugin in current system
|
---|
| 710 | * runjosm Install plugin and start josm
|
---|
| 711 | * profilejosm Install plugin and start josm in profiling mode
|
---|
[32052] | 712 |
|
---|
[29004] | 713 | There are other targets, which usually should not be called manually.
|
---|
| 714 | </echo>
|
---|
| 715 | </target>
|
---|
[34581] | 716 | <!--
|
---|
| 717 | ** Ivy tasks
|
---|
| 718 | -->
|
---|
| 719 | <target name="download-ivy">
|
---|
| 720 | <mkdir dir="${ivy.jar.dir}"/>
|
---|
[35390] | 721 | <get src="https://josm.openstreetmap.de/nexus/content/repositories/public/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"
|
---|
| 722 | dest="${ivy.jar.file}"
|
---|
| 723 | usetimestamp="true"/>
|
---|
[34581] | 724 | </target>
|
---|
| 725 | <target name="init-ivy" depends="download-ivy">
|
---|
| 726 | <path id="ivy.lib.path">
|
---|
| 727 | <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
|
---|
| 728 | </path>
|
---|
| 729 | <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
|
---|
| 730 | </target>
|
---|
[35389] | 731 | <target name="resolve-tools" depends="init-ivy" description="Resolves tools using Apache Ivy">
|
---|
| 732 | <ivy:resolve file="${core.tools.ivy}"/>
|
---|
| 733 | <ivy:cachepath file="${core.tools.ivy}" pathid="checkstyle.classpath" conf="checkstyle"/>
|
---|
| 734 | <ivy:cachepath file="${core.tools.ivy}" pathid="spotbugs.classpath" conf="spotbugs"/>
|
---|
| 735 | </target>
|
---|
[34703] | 736 | <target name="clean_ivy">
|
---|
| 737 | <delete failonerror="false">
|
---|
| 738 | <fileset dir="${plugin.lib.dir}">
|
---|
| 739 | <include name="**/*.jar"/>
|
---|
| 740 | <exclude name="**/*-custom.jar" />
|
---|
| 741 | </fileset>
|
---|
| 742 | </delete>
|
---|
| 743 | </target>
|
---|
| 744 | <target name="fetch_dependencies" depends="clean_ivy, init-ivy">
|
---|
| 745 | <echo>fetching dependencies with ivy</echo>
|
---|
| 746 | <ivy:settings file="ivy_settings.xml" />
|
---|
| 747 | <ivy:retrieve pattern="${plugin.lib.dir}/[artifact]-[revision](-[classifier]).[ext]" conf="default" />
|
---|
| 748 | </target>
|
---|
[26341] | 749 | </project>
|
---|