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