[4166] | 1 | <?xml version="1.0" encoding="utf-8"?>
|
---|
| 2 | <!-- ** build.xml - main ant file for JOSM
|
---|
| 3 | **
|
---|
| 4 | ** To build run
|
---|
| 5 | ** ant clean
|
---|
| 6 | ** ant dist
|
---|
[7133] | 7 | ** This will create 'josm-custom.jar' in directory 'dist'. See also
|
---|
[7183] | 8 | ** https://josm.openstreetmap.de/wiki/DevelopersGuide/CreateBuild
|
---|
[4166] | 9 | **
|
---|
| 10 | -->
|
---|
[15977] | 11 | <project name="josm" default="dist"
|
---|
| 12 | xmlns:as="antlib:org.codehaus.mojo.animal_sniffer"
|
---|
| 13 | xmlns:if="ant:if"
|
---|
| 14 | xmlns:ivy="antlib:org.apache.ivy.ant"
|
---|
| 15 | xmlns:jacoco="antlib:org.jacoco.ant"
|
---|
| 16 | xmlns:unless="ant:unless"
|
---|
| 17 | >
|
---|
[17338] | 18 | <target name="init-ivy" description="Initialize dependency management system Apache Ivy">
|
---|
[16183] | 19 | <property name="ivy.version" value="2.5.0"/>
|
---|
[15977] | 20 | <dirname property="base.dir" file="${ant.file.josm}"/>
|
---|
| 21 | <property name="lib.dir" location="${base.dir}/lib"/>
|
---|
| 22 | <property name="tools.dir" location="${base.dir}/tools"/>
|
---|
[16168] | 23 | <property name="tools.ivy" location="${tools.dir}/ivy.xml"/>
|
---|
[16183] | 24 | <property name="ivy.jar.dir" location="${tools.dir}/ivy"/>
|
---|
| 25 | <property name="ivy.jar.file" location="${ivy.jar.dir}/ivy-${ivy.version}.jar"/>
|
---|
| 26 | <mkdir dir="${ivy.jar.dir}"/>
|
---|
| 27 | <get src="https://josm.openstreetmap.de/nexus/content/repositories/public/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"
|
---|
| 28 | dest="${ivy.jar.file}"
|
---|
| 29 | skipexisting="true"
|
---|
| 30 | />
|
---|
| 31 | <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar.file}"/>
|
---|
[15977] | 32 | </target>
|
---|
[17338] | 33 | <target name="init-properties" description="Initialize properties for the build">
|
---|
[13641] | 34 | <property environment="env"/>
|
---|
[9765] | 35 | <!-- Load properties in a target and not at top level, so this build file can be
|
---|
| 36 | imported from an IDE ant file (Netbeans) without messing up IDE properties.
|
---|
| 37 | When imported from another file, ${basedir} will point to the parent directory
|
---|
| 38 | of the importing ant file. Use ${base.dir} instead, which is always the parent
|
---|
| 39 | directory of this file. -->
|
---|
[16878] | 40 | <dirname property="base.dir" file="${ant.file.josm}"/>
|
---|
[9765] | 41 | <property name="test.dir" location="${base.dir}/test"/>
|
---|
| 42 | <property name="src.dir" location="${base.dir}/src"/>
|
---|
[13819] | 43 | <condition property="noJavaFX">
|
---|
| 44 | <or>
|
---|
[13642] | 45 | <isset property="env.JOSM_NOJAVAFX"/>
|
---|
[13819] | 46 | <not>
|
---|
| 47 | <available classname="javafx.scene.media.Media"/>
|
---|
| 48 | </not>
|
---|
| 49 | </or>
|
---|
[13641] | 50 | </condition>
|
---|
[16341] | 51 | <available property="svn.present" file="${base.dir}/.svn"/>
|
---|
| 52 | <available property="git.present" file="${base.dir}/.git"/>
|
---|
[9765] | 53 | <property name="build.dir" location="${base.dir}/build"/>
|
---|
| 54 | <property name="dist.dir" location="${base.dir}/dist"/>
|
---|
[16140] | 55 | <property name="resources.dir" location="${base.dir}/resources"/>
|
---|
[14136] | 56 | <property name="modules.dir" location="${dist.dir}/modules"/>
|
---|
[13209] | 57 | <property name="tools.dir" location="${base.dir}/tools"/>
|
---|
| 58 | <property name="pmd.dir" location="${tools.dir}/pmd"/>
|
---|
| 59 | <property name="checkstyle.dir" location="${tools.dir}/checkstyle"/>
|
---|
| 60 | <property name="spotbugs.dir" location="${tools.dir}/spotbugs"/>
|
---|
| 61 | <property name="javacc.home" location="${tools.dir}"/>
|
---|
[9765] | 62 | <property name="mapcss.dir" location="${src.dir}/org/openstreetmap/josm/gui/mappaint/mapcss"/>
|
---|
| 63 | <property name="proj-build.dir" location="${base.dir}/build2"/>
|
---|
[15033] | 64 | <property name="script-build.dir" location="${base.dir}/build2"/>
|
---|
[12582] | 65 | <property name="checkstyle-build.dir" location="${base.dir}/build2"/>
|
---|
[16140] | 66 | <property name="epsg.output" location="${resources.dir}/data/projection/custom-epsg"/>
|
---|
[16231] | 67 | <property name="commons-lang3.jar" location="${tools.dir}/commons-lang3.jar"/>
|
---|
[12628] | 68 | <property name="dist.jar" location="${dist.dir}/josm-custom.jar"/>
|
---|
| 69 | <property name="dist-optimized.jar" location="${dist.dir}/josm-custom-optimized.jar"/>
|
---|
[16141] | 70 | <property name="dist-sources.jar" location="${dist.dir}/josm-custom-sources.jar"/>
|
---|
[17906] | 71 | <property name="java.lang.version" value="8" />
|
---|
[14052] | 72 | <property name="test.headless" value="true" />
|
---|
[13103] | 73 | <property name="jacoco.includes" value="org.openstreetmap.josm.*" />
|
---|
[13097] | 74 | <property name="jacoco.inclbootstrapclasses" value="false" />
|
---|
| 75 | <property name="jacoco.inclnolocationclasses" value="false" />
|
---|
[14309] | 76 | <property name="junit.printsummary" value="on" />
|
---|
[15032] | 77 | <property name="default-junit-includes" value="**/*Test.class"/>
|
---|
| 78 | <property name="default-junitIT-includes" value="**/*TestIT.class"/>
|
---|
[9765] | 79 | <!-- build parameter: compression level (ant -Dclevel=N)
|
---|
| 80 | N ranges from 0 (no compression) to 9 (maximum compression)
|
---|
| 81 | default: 9 -->
|
---|
| 82 | <condition property="clevel" value="${clevel}" else="9">
|
---|
| 83 | <isset property="clevel"/>
|
---|
| 84 | </condition>
|
---|
[14172] | 85 | <!-- For Java specific stuff by version -->
|
---|
| 86 | <condition property="isJava9"><matches string="${ant.java.version}" pattern="(1.)?(9|1[0-9])" /></condition>
|
---|
| 87 | <condition property="isJava10"><matches string="${ant.java.version}" pattern="1[0-9]" /></condition>
|
---|
| 88 | <condition property="isJava11"><matches string="${ant.java.version}" pattern="1[1-9]" /></condition>
|
---|
| 89 | <condition property="isJava12"><matches string="${ant.java.version}" pattern="1[2-9]" /></condition>
|
---|
| 90 | <condition property="isJava13"><matches string="${ant.java.version}" pattern="1[3-9]" /></condition>
|
---|
[17538] | 91 | <condition property="isJava14"><matches string="${ant.java.version}" pattern="1[4-9]" /></condition>
|
---|
[16156] | 92 | <condition property="isJava16"><matches string="${ant.java.version}" pattern="1[6-9]" /></condition>
|
---|
[17538] | 93 | <condition property="isJava18"><matches string="${ant.java.version}" pattern="1[8-9]" /></condition>
|
---|
| 94 | <!-- Disable jacoco on Java 18+, see https://github.com/jacoco/jacoco/pull/1132 -->
|
---|
[13523] | 95 | <condition property="coverageByDefault">
|
---|
| 96 | <not>
|
---|
[17538] | 97 | <isset property="isJava18"/>
|
---|
[13523] | 98 | </not>
|
---|
| 99 | </condition>
|
---|
[14244] | 100 | <condition property="java.library.dir" value="jmods" else="lib">
|
---|
| 101 | <isset property="isJava9"/>
|
---|
| 102 | </condition>
|
---|
[9765] | 103 | </target>
|
---|
[17338] | 104 | <target name="init-svn-revision-xml" if="svn.present" depends="init-properties"
|
---|
| 105 | description="Initialize the REVISION.XML file from SVN information">
|
---|
[16341] | 106 | <exec append="false" output="${base.dir}/REVISION.XML" executable="svn" dir="${base.dir}" resultproperty="svn.info.result">
|
---|
[4166] | 107 | <env key="LANG" value="C"/>
|
---|
| 108 | <arg value="info"/>
|
---|
| 109 | <arg value="--xml"/>
|
---|
| 110 | <arg value="."/>
|
---|
| 111 | </exec>
|
---|
[6540] | 112 | </target>
|
---|
[17338] | 113 | <target name="init-git-revision-xml" if="git.present" depends="init-properties"
|
---|
| 114 | description="Initialize the REVISION.XML file from git information">
|
---|
[16341] | 115 | <exec append="false" output="${base.dir}/REVISION.XML" executable="git" dir="${base.dir}">
|
---|
[6540] | 116 | <arg value="log"/>
|
---|
| 117 | <arg value="-1"/>
|
---|
| 118 | <arg value="--grep=git-svn-id"/>
|
---|
[6545] | 119 | <!--
|
---|
| 120 | %B: raw body (unwrapped subject and body)
|
---|
| 121 | %n: new line
|
---|
| 122 | %ai: author date, ISO 8601 format
|
---|
| 123 | -->
|
---|
| 124 | <arg value="--pretty=format:%B%n%ai"/>
|
---|
[6540] | 125 | <arg value="HEAD"/>
|
---|
| 126 | </exec>
|
---|
[9765] | 127 | <replaceregexp file="${base.dir}/REVISION.XML" flags="s"
|
---|
[6545] | 128 | match=".*git-svn-id: [^@]*@([0-9]+).*(\d{4}-\d{2}-\d{2}.\d{2}\:\d{2}\:\d{2}\s*[+-]\d{2}:?\d{2})\s*$"
|
---|
| 129 | replace="<info><entry><commit revision="\1"><date>\2</date></commit></entry></info>"/>
|
---|
[6540] | 130 | </target>
|
---|
[17338] | 131 | <target name="create-revision" depends="init-properties,init-svn-revision-xml,init-git-revision-xml"
|
---|
| 132 | description="Create the REVISION file to be included in the distribution based on the latest SVN/Git commit">
|
---|
[9765] | 133 | <xmlproperty file="${base.dir}/REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
| 134 | <delete file="${base.dir}/REVISION.XML"/>
|
---|
[4166] | 135 | <tstamp>
|
---|
| 136 | <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss"/>
|
---|
| 137 | </tstamp>
|
---|
| 138 | <property name="version.entry.commit.revision" value="UNKNOWN"/>
|
---|
[6540] | 139 | <property name="version.entry.commit.date" value="UNKNOWN"/>
|
---|
[5362] | 140 | <!-- add Build-Name: ... when making special builds, e.g. DEBIAN -->
|
---|
[16349] | 141 | <echo file="${resources.dir}/REVISION">
|
---|
[4166] | 142 | # automatically generated by JOSM build.xml - do not edit
|
---|
| 143 | Revision: ${version.entry.commit.revision}
|
---|
| 144 | Build-Date: ${build.tstamp}
|
---|
| 145 | </echo>
|
---|
[17493] | 146 | <echo unless:set="releasebuild" file="${resources.dir}/REVISION" append="true">
|
---|
| 147 | Is-Local-Build: true
|
---|
| 148 | </echo>
|
---|
[4166] | 149 | </target>
|
---|
[17338] | 150 | <target name="check-schemas" unless="check-schemas.notRequired" depends="init-properties"
|
---|
| 151 | description="Check internal XML files against their XSD">
|
---|
[16140] | 152 | <schemavalidate file="${resources.dir}/data/defaultpresets.xml" >
|
---|
| 153 | <schema namespace="http://josm.openstreetmap.de/tagging-preset-1.0" file="${resources.dir}/data/tagging-preset.xsd" />
|
---|
[6208] | 154 | </schemavalidate>
|
---|
| 155 | </target>
|
---|
[17338] | 156 | <target name="dist" depends="compile,extract-libraries,epsg,copy-resources,check-schemas"
|
---|
| 157 | description="Main target that builds JOSM and checks XML against schemas">
|
---|
[4166] | 158 | <echo>Revision ${version.entry.commit.revision}</echo>
|
---|
[12648] | 159 | <copy file="CONTRIBUTION" todir="${build.dir}"/>
|
---|
| 160 | <copy file="README" todir="${build.dir}"/>
|
---|
| 161 | <copy file="LICENSE" todir="${build.dir}"/>
|
---|
[4166] | 162 | <!-- create josm-custom.jar -->
|
---|
[12628] | 163 | <delete file="${dist.jar}"/>
|
---|
| 164 | <jar destfile="${dist.jar}" basedir="${build.dir}" level="${clevel}">
|
---|
[4166] | 165 | <!-- add attribute excludes="**/*BZip2*,**/*Bzip2*" to create a non-bzip2 supporting jar -->
|
---|
| 166 | <manifest>
|
---|
[11926] | 167 | <attribute name="Main-class" value="org.openstreetmap.josm.gui.MainApplication"/>
|
---|
[4166] | 168 | <attribute name="Main-Version" value="${version.entry.commit.revision} SVN"/>
|
---|
| 169 | <attribute name="Main-Date" value="${version.entry.commit.date}"/>
|
---|
[6341] | 170 | <attribute name="Permissions" value="all-permissions"/>
|
---|
| 171 | <attribute name="Codebase" value="josm.openstreetmap.de"/>
|
---|
| 172 | <attribute name="Application-Name" value="JOSM - Java OpenStreetMap Editor"/>
|
---|
[12205] | 173 | <!-- Java 9 stuff. Entries are safely ignored by Java 8 -->
|
---|
[15469] | 174 | <attribute name="Add-Exports" value="java.desktop/com.apple.eawt java.desktop/com.sun.imageio.spi java.desktop/com.sun.imageio.plugins.jpeg javafx.graphics/com.sun.javafx.application jdk.deploy/com.sun.deploy.config" />
|
---|
[12932] | 175 | <attribute name="Add-Opens" value="java.base/java.lang java.base/java.nio java.base/jdk.internal.loader java.base/jdk.internal.ref java.desktop/javax.imageio.spi java.desktop/javax.swing.text.html java.prefs/java.util.prefs" />
|
---|
[4166] | 176 | </manifest>
|
---|
| 177 | </jar>
|
---|
| 178 | </target>
|
---|
[7839] | 179 | <!-- Windows target -->
|
---|
| 180 | <target name="distwin" depends="dist">
|
---|
[16007] | 181 | <exec dir="native/windows" executable="./josm-setup-unix.sh">
|
---|
[7839] | 182 | <arg value="${version.entry.commit.revision}"/>
|
---|
[12628] | 183 | <arg value="${dist.jar}"/>
|
---|
[7839] | 184 | </exec>
|
---|
| 185 | </target>
|
---|
[17338] | 186 | <target name="javacc" depends="init" unless="javacc.notRequired" description="Compile the MapCSS compiler">
|
---|
[16243] | 187 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="javacc.classpath" conf="javacc"/>
|
---|
[4252] | 188 | <mkdir dir="${mapcss.dir}/parsergen"/>
|
---|
[17908] | 189 | <java classname="javacc" fork="true" dir="${mapcss.dir}" failonerror="true">
|
---|
[16908] | 190 | <classpath path="${tools.dir}/javacc"/>
|
---|
[16168] | 191 | <classpath refid="javacc.classpath"/>
|
---|
[7043] | 192 | <arg value="-DEBUG_PARSER=false"/>
|
---|
| 193 | <arg value="-DEBUG_TOKEN_MANAGER=false"/>
|
---|
[17906] | 194 | <arg value="-JDK_VERSION=1.${java.lang.version}"/>
|
---|
[6446] | 195 | <arg value="-GRAMMAR_ENCODING=UTF-8"/>
|
---|
[17908] | 196 | <arg value="-UNICODE_INPUT=true"/>
|
---|
[4257] | 197 | <arg value="${mapcss.dir}/MapCSSParser.jj"/>
|
---|
[11676] | 198 | </java>
|
---|
[4252] | 199 | </target>
|
---|
[17338] | 200 | <target name="compile-cots" depends="init" description="Compile third-party dependencies not retrieved with Ivy">
|
---|
[7068] | 201 | <!-- COTS -->
|
---|
[16537] | 202 | <javac srcdir="${src.dir}" includes="com/kitfox/**" excludes="**/package-info.java" nowarn="on" encoding="iso-8859-1"
|
---|
[17906] | 203 | destdir="${build.dir}" release="${java.lang.version}" debug="on" includeAntRuntime="false">
|
---|
[7019] | 204 | <!-- get rid of "internal proprietary API" warning -->
|
---|
[7068] | 205 | <compilerarg value="-XDignore.symbol.file"/>
|
---|
[16050] | 206 | <classpath>
|
---|
| 207 | <path refid="runtime.path"/>
|
---|
| 208 | </classpath>
|
---|
[7019] | 209 | </javac>
|
---|
[12648] | 210 | </target>
|
---|
[17338] | 211 | <target name="compile" depends="init,javacc,compile-cots" unless="compile.notRequired" description="Compile JOSM">
|
---|
[16556] | 212 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="errorprone.classpath" conf="errorprone"/>
|
---|
[16571] | 213 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="errorprone_javac.classpath" conf="errorprone_javac"/>
|
---|
[8526] | 214 | <!-- JOSM -->
|
---|
[14222] | 215 | <javac sourcepath="" srcdir="${src.dir}" fork="yes"
|
---|
[16556] | 216 | excludes="com/**,org/apache/commons/**,**/package-info.java"
|
---|
[17906] | 217 | destdir="${build.dir}" release="${java.lang.version}" debug="on" includeantruntime="false" encoding="UTF-8">
|
---|
[16571] | 218 | <compilerarg value="-J-Xbootclasspath/p:${toString:errorprone_javac.classpath}" unless:set="isJava9"/>
|
---|
[17520] | 219 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 220 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 221 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 222 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 223 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 224 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 225 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 226 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 227 | <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
[14222] | 228 | <compilerarg line="-XDcompilePolicy=simple"/>
|
---|
| 229 | <compilerarg value="-processorpath"/>
|
---|
[16556] | 230 | <compilerarg pathref="errorprone.classpath"/>
|
---|
[8526] | 231 | <compilerarg value="-Xlint:cast"/>
|
---|
| 232 | <compilerarg value="-Xlint:deprecation"/>
|
---|
| 233 | <compilerarg value="-Xlint:dep-ann"/>
|
---|
| 234 | <compilerarg value="-Xlint:divzero"/>
|
---|
| 235 | <compilerarg value="-Xlint:empty"/>
|
---|
| 236 | <compilerarg value="-Xlint:finally"/>
|
---|
| 237 | <compilerarg value="-Xlint:overrides"/>
|
---|
| 238 | <!--<compilerarg value="-Xlint:rawtypes"/>-->
|
---|
| 239 | <compilerarg value="-Xlint:static"/>
|
---|
| 240 | <compilerarg value="-Xlint:try"/>
|
---|
| 241 | <compilerarg value="-Xlint:unchecked"/>
|
---|
| 242 | <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
|
---|
| 243 | <compilerarg value="-XDignore.symbol.file"/>
|
---|
[17905] | 244 | <compilerarg value="-Xplugin:ErrorProne -XepExcludedPaths:.*/parsergen/.* -Xep:ReferenceEquality:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:JdkObsolete:OFF -Xep:EqualsGetClass:OFF -Xep:UndefinedEquals:OFF -Xep:BadImport:OFF -Xep:AnnotateFormatMethod:OFF -Xep:JavaUtilDate:OFF -Xep:DoNotCallSuggester:OFF -Xep:BanSerializableRead:OFF -Xep:RestrictedApiChecker:OFF -Xep:InlineMeSuggester:OFF" unless:set="noErrorProne"/>
|
---|
[10659] | 245 | <compilerarg line="-Xmaxwarns 1000"/>
|
---|
[15977] | 246 | <classpath>
|
---|
| 247 | <path refid="runtime.path"/>
|
---|
| 248 | </classpath>
|
---|
[8526] | 249 | </javac>
|
---|
[16036] | 250 | </target>
|
---|
[16349] | 251 | <target name="create-resources" depends="create-revision" description="Create generated resource files">
|
---|
| 252 | <copy todir="${resources.dir}">
|
---|
| 253 | <file file="CONTRIBUTION"/>
|
---|
| 254 | <file file="README"/>
|
---|
| 255 | <file file="LICENSE"/>
|
---|
| 256 | </copy>
|
---|
| 257 | </target>
|
---|
| 258 | <target name="copy-resources" depends="create-resources" description="Copy resource files to build directory">
|
---|
[6756] | 259 | <copy todir="build" failonerror="no" includeemptydirs="no">
|
---|
[16140] | 260 | <fileset dir="${resources.dir}"/>
|
---|
[6756] | 261 | </copy>
|
---|
[4166] | 262 | </target>
|
---|
[17338] | 263 | <target name="init" depends="init-properties,resolve" description="Initialize the build">
|
---|
[5392] | 264 | <uptodate property="javacc.notRequired" targetfile="${mapcss.dir}/parsergen/MapCSSParser.java" >
|
---|
| 265 | <srcfiles dir="${mapcss.dir}" includes="MapCSSParser.jj"/>
|
---|
| 266 | </uptodate>
|
---|
[16345] | 267 | <uptodate property="epsg.notRequired" targetfile="${epsg.output}">
|
---|
| 268 | <srcfiles file="${base.dir}/scripts/BuildProjectionDefinitions.java"/>
|
---|
| 269 | <srcfiles dir="nodist/data/projection"/>
|
---|
| 270 | </uptodate>
|
---|
[9765] | 271 | <mkdir dir="${build.dir}"/>
|
---|
| 272 | <mkdir dir="${dist.dir}"/>
|
---|
[4166] | 273 | </target>
|
---|
[17338] | 274 | <target name="javadoc" depends="init" description="Generate API documentation from JOSM source files">
|
---|
[9765] | 275 | <javadoc destdir="javadoc"
|
---|
[7133] | 276 | sourcepath="${src.dir}"
|
---|
[15992] | 277 | classpathref="compile.path"
|
---|
[9765] | 278 | encoding="UTF-8"
|
---|
[16194] | 279 | packagenames="org.openstreetmap.josm.*"
|
---|
[9250] | 280 | excludepackagenames="org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.*"
|
---|
[5263] | 281 | windowtitle="JOSM"
|
---|
| 282 | use="true"
|
---|
[5481] | 283 | private="true"
|
---|
[5263] | 284 | linksource="true"
|
---|
| 285 | author="false">
|
---|
[15106] | 286 | <link href="https://docs.oracle.com/javase/8/docs/api" unless:set="isJava11" />
|
---|
| 287 | <link href="https://docs.oracle.com/en/java/javase/11/docs/api" if:set="isJava11" />
|
---|
[16348] | 288 | <doctitle><![CDATA[<h2>
|
---|
| 289 | <img src="https://josm.openstreetmap.de/svn/trunk/nodist/images/logo/header.png" style="vertical-align: middle;" alt="JOSM">
|
---|
| 290 | — Javadoc
|
---|
| 291 | </h2>]]></doctitle>
|
---|
[6955] | 292 | <bottom><![CDATA[<a href="https://josm.openstreetmap.de/">JOSM</a>]]></bottom>
|
---|
[15243] | 293 | <!-- Disable HTML checking until we switch to Java13+, see https://bugs.openjdk.java.net/browse/JDK-8223552 -->
|
---|
| 294 | <arg value="-Xdoclint:-html" if:set="isJava13" />
|
---|
[13494] | 295 | <arg value="-html5" if:set="isJava9" />
|
---|
[13820] | 296 | <arg value="--add-exports" if:set="isJava9" unless:set="noJavaFX" />
|
---|
| 297 | <arg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" if:set="isJava9" unless:set="noJavaFX" />
|
---|
[5263] | 298 | </javadoc>
|
---|
| 299 | </target>
|
---|
[17338] | 300 | <target name="clean" depends="init-properties" description="Delete all build files">
|
---|
[9765] | 301 | <delete dir="${build.dir}"/>
|
---|
| 302 | <delete dir="${proj-build.dir}"/>
|
---|
[15033] | 303 | <delete dir="${script-build.dir}"/>
|
---|
[12582] | 304 | <delete dir="${checkstyle-build.dir}"/>
|
---|
[9765] | 305 | <delete dir="${dist.dir}"/>
|
---|
[4252] | 306 | <delete dir="${mapcss.dir}/parsergen"/>
|
---|
[8535] | 307 | <delete file="${src.dir}/org/w3/_2001/xmlschema/Adapter1.java"/>
|
---|
| 308 | <delete dir="${src.dir}/org/openstreetmap/josm/data/imagery/types"/>
|
---|
[9133] | 309 | <delete file="${epsg.output}"/>
|
---|
[13209] | 310 | <delete file="${pmd.dir}/cache"/>
|
---|
[4166] | 311 | </target>
|
---|
[7068] | 312 | <macrodef name="init-test-preferences">
|
---|
| 313 | <attribute name="testfamily"/>
|
---|
| 314 | <sequential>
|
---|
| 315 | <copy file="${test.dir}/config/preferences.template.xml" tofile="${test.dir}/config/@{testfamily}-josm.home/preferences.xml"/>
|
---|
| 316 | <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/>
|
---|
| 317 | <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/>
|
---|
| 318 | </sequential>
|
---|
| 319 | </macrodef>
|
---|
[17338] | 320 | <target name="test-init" depends="init" description="Initialize the tests">
|
---|
[6121] | 321 | <mkdir dir="${test.dir}/build"/>
|
---|
[7068] | 322 | <mkdir dir="${test.dir}/build/unit"/>
|
---|
| 323 | <mkdir dir="${test.dir}/build/functional"/>
|
---|
| 324 | <mkdir dir="${test.dir}/build/performance"/>
|
---|
[4166] | 325 | <mkdir dir="${test.dir}/report"/>
|
---|
[7068] | 326 | <init-test-preferences testfamily="unit"/>
|
---|
| 327 | <init-test-preferences testfamily="functional"/>
|
---|
| 328 | <init-test-preferences testfamily="performance"/>
|
---|
[16229] | 329 | <path id="test.classpath">
|
---|
| 330 | <path refid="test.path"/>
|
---|
| 331 | <pathelement path="${build.dir}"/>
|
---|
| 332 | <pathelement path="${resources.dir}"/>
|
---|
| 333 | </path>
|
---|
[16243] | 334 | <ivy:retrieve log="download-only" pattern="${test.dir}/lib/[artifact].[ext]" conf="jmockit"/>
|
---|
| 335 | <ivy:retrieve log="download-only" pattern="${tools.dir}/[artifact].[ext]" conf="commonslang"/>
|
---|
| 336 | <ivy:retrieve log="download-only" pattern="${tools.dir}/[conf].[ext]" conf="jacocoant"/>
|
---|
[13209] | 337 | <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="${tools.dir}/jacocoant.jar" />
|
---|
[4166] | 338 | </target>
|
---|
[17338] | 339 | <target name="test-clean" depends="init-properties" description="Delete all built test files">
|
---|
[6121] | 340 | <delete dir="${test.dir}/build"/>
|
---|
[4166] | 341 | <delete dir="${test.dir}/report"/>
|
---|
[6133] | 342 | <delete file="${test.dir}/jacoco.exec" />
|
---|
[9501] | 343 | <delete file="${test.dir}/jacocoIT.exec" />
|
---|
[10850] | 344 | <delete file="${test.dir}/config/unit-josm.home" failonerror="false"/>
|
---|
| 345 | <delete file="${test.dir}/config/functional-josm.home" failonerror="false"/>
|
---|
| 346 | <delete file="${test.dir}/config/performance-josm.home" failonerror="false"/>
|
---|
[4166] | 347 | </target>
|
---|
[14065] | 348 | <macrodef name="call-javac">
|
---|
[7068] | 349 | <attribute name="testfamily"/>
|
---|
| 350 | <element name="cp-elements"/>
|
---|
| 351 | <sequential>
|
---|
[14065] | 352 | <javac srcdir="${test.dir}/@{testfamily}" destdir="${test.dir}/build/@{testfamily}"
|
---|
[17906] | 353 | release="${java.lang.version}" debug="on"
|
---|
[16346] | 354 | includeantruntime="false" encoding="UTF-8">
|
---|
[14065] | 355 | <compilerarg value="-Xlint:all"/>
|
---|
[16603] | 356 | <compilerarg value="-Xlint:-path"/><!-- Suppress "bad path element .../xmpcore-6.0.6.jar: no such file or directory" warning, see https://github.com/drewnoakes/metadata-extractor/pull/483 -->
|
---|
[14065] | 357 | <compilerarg value="-Xlint:-serial"/>
|
---|
[7068] | 358 | <classpath>
|
---|
| 359 | <cp-elements/>
|
---|
| 360 | </classpath>
|
---|
[14065] | 361 | </javac>
|
---|
[7068] | 362 | </sequential>
|
---|
| 363 | </macrodef>
|
---|
[17338] | 364 | <target name="test-compile" depends="test-init,compile,extract-libraries,epsg,copy-resources" description="Compile all tests">
|
---|
[14065] | 365 | <call-javac testfamily="unit">
|
---|
[7068] | 366 | <cp-elements>
|
---|
| 367 | <path refid="test.classpath"/>
|
---|
| 368 | </cp-elements>
|
---|
[14065] | 369 | </call-javac>
|
---|
| 370 | <call-javac testfamily="functional">
|
---|
[7068] | 371 | <cp-elements>
|
---|
| 372 | <path refid="test.classpath"/>
|
---|
| 373 | <pathelement path="${test.dir}/build/unit"/>
|
---|
| 374 | </cp-elements>
|
---|
[14065] | 375 | </call-javac>
|
---|
| 376 | <call-javac testfamily="performance">
|
---|
[7068] | 377 | <cp-elements>
|
---|
| 378 | <path refid="test.classpath"/>
|
---|
| 379 | <pathelement path="${test.dir}/build/unit"/>
|
---|
| 380 | </cp-elements>
|
---|
[14065] | 381 | </call-javac>
|
---|
[4166] | 382 | </target>
|
---|
[7068] | 383 | <macrodef name="call-junit">
|
---|
| 384 | <attribute name="testfamily"/>
|
---|
[9501] | 385 | <attribute name="testITsuffix" default=""/>
|
---|
[13523] | 386 | <attribute name="coverage" default="${coverageByDefault}"/>
|
---|
[15032] | 387 | <attribute name="includes" default="${default-junit@{testITsuffix}-includes}"/>
|
---|
| 388 | <attribute name="excludes" default="${default-junit@{testITsuffix}-excludes}"/>
|
---|
[7068] | 389 | <sequential>
|
---|
[9501] | 390 | <echo message="Running @{testfamily}@{testITsuffix} tests with JUnit"/>
|
---|
[16617] | 391 | <jacoco:agent destfile="${test.dir}/jacoco@{testITsuffix}.exec" enabled="@{coverage}" includes="${jacoco.includes}" dumponexit="true"
|
---|
| 392 | inclbootstrapclasses="${jacoco.inclbootstrapclasses}" inclnolocationclasses="${jacoco.inclnolocationclasses}" property="jacocoagent@{testfamily}@{testITsuffix}" if:true="@{coverage}"/>
|
---|
| 393 | <junitlauncher printsummary="${junit.printsummary}" failureproperty="test.@{testfamily}@{testITsuffix}.failed">
|
---|
| 394 | <classpath>
|
---|
| 395 | <path refid="test.classpath"/>
|
---|
| 396 | <pathelement path="${test.dir}/build/unit"/> <!-- required for functional/etc to have JOSMTestRules -->
|
---|
| 397 | <pathelement path="${test.dir}/build/@{testfamily}"/>
|
---|
| 398 | </classpath>
|
---|
| 399 | <testclasses outputDir="${test.dir}/report">
|
---|
| 400 | <fileset dir="${test.dir}/build/@{testfamily}" includes="@{includes}" excludes="@{excludes}"/>
|
---|
| 401 | <fork>
|
---|
| 402 | <jvmarg value="${jacocoagent@{testfamily}@{testITsuffix}}" if:set="jacocoagent@{testfamily}@{testITsuffix}" />
|
---|
| 403 | <jvmarg value="-Dfile.encoding=UTF-8"/>
|
---|
| 404 | <jvmarg value="-javaagent:${test.dir}/lib/jmockit.jar"/>
|
---|
[16659] | 405 | <jvmarg value="-Djunit.jupiter.extensions.autodetection.enabled=true"/>
|
---|
[17478] | 406 | <jvmarg value="-Djunit.jupiter.execution.parallel.enabled=true"/>
|
---|
[16617] | 407 | <jvmarg value="--add-modules" if:set="isJava9" unless:set="isJava11" />
|
---|
| 408 | <jvmarg value="java.activation,java.se.ee" if:set="isJava9" unless:set="isJava11" />
|
---|
| 409 | <jvmarg value="--add-exports" if:set="isJava9" unless:set="noJavaFX" />
|
---|
| 410 | <jvmarg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" if:set="isJava9" unless:set="noJavaFX" />
|
---|
| 411 | <jvmarg value="--add-exports" if:set="isJava9" unless:set="isJava11" />
|
---|
| 412 | <jvmarg value="jdk.deploy/com.sun.deploy.config=ALL-UNNAMED" if:set="isJava9" unless:set="isJava11" />
|
---|
| 413 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 414 | <jvmarg value="java.base/java.io=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 415 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 416 | <jvmarg value="java.base/java.lang=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 417 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 418 | <jvmarg value="java.base/java.nio=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 419 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 420 | <jvmarg value="java.base/java.text=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 421 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 422 | <jvmarg value="java.base/java.util=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 423 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 424 | <jvmarg value="java.base/jdk.internal.loader=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 425 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 426 | <jvmarg value="java.desktop/java.awt=ALL-UNNAMED" if:set="isJava9" />
|
---|
[17689] | 427 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 428 | <jvmarg value="java.prefs/java.util.prefs=ALL-UNNAMED" if:set="isJava9" />
|
---|
[16617] | 429 | <sysproperty key="josm.home" value="${test.dir}/config/@{testfamily}-josm.home"/>
|
---|
| 430 | <sysproperty key="josm.test.data" value="${test.dir}/data"/>
|
---|
| 431 | <sysproperty key="java.awt.headless" value="${test.headless}"/>
|
---|
| 432 | <sysproperty key="glass.platform" value="Monocle"/>
|
---|
| 433 | <sysproperty key="monocle.platform" value="Headless"/>
|
---|
| 434 | <sysproperty key="prism.order" value="sw"/>
|
---|
| 435 | <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
|
---|
[17403] | 436 | <sysproperty key="junit.jupiter.execution.parallel.enabled" value="${junit.jupiter.execution.parallel.enabled}" if:set="junit.jupiter.execution.parallel.enabled"/>
|
---|
| 437 | <sysproperty key="junit.jupiter.execution.parallel.mode.default" value="${junit.jupiter.execution.parallel.mode.default}" if:set="junit.jupiter.execution.parallel.mode.default"/>
|
---|
| 438 | <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"/>
|
---|
[16617] | 439 | </fork>
|
---|
| 440 | <listener type="legacy-plain" />
|
---|
| 441 | <listener type="legacy-xml" />
|
---|
| 442 | </testclasses>
|
---|
| 443 | </junitlauncher>
|
---|
[7068] | 444 | </sequential>
|
---|
| 445 | </macrodef>
|
---|
[9501] | 446 | <target name="test" depends="test-compile" unless="test.notRequired"
|
---|
[12534] | 447 | description="Run unit and functional tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
|
---|
[7068] | 448 | <call-junit testfamily="unit"/>
|
---|
| 449 | <call-junit testfamily="functional"/>
|
---|
[4166] | 450 | </target>
|
---|
[14141] | 451 | <target name="test-hardfail" depends="test" description="Run 'test' target but abort if tests failed">
|
---|
| 452 | <fail message="'test' failed">
|
---|
| 453 | <condition>
|
---|
| 454 | <or>
|
---|
| 455 | <isset property="test.unit.failed"/>
|
---|
| 456 | <isset property="test.functional.failed"/>
|
---|
| 457 | </or>
|
---|
| 458 | </condition>
|
---|
| 459 | </fail>
|
---|
| 460 | </target>
|
---|
| 461 | <target name="test-unit" depends="test-compile" unless="test-unit.notRequired"
|
---|
| 462 | description="Run unit tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
|
---|
| 463 | <call-junit testfamily="unit"/>
|
---|
| 464 | </target>
|
---|
| 465 | <target name="test-unit-hardfail" depends="test-unit" description="Run 'test-unit' target but abort if tests failed">
|
---|
| 466 | <fail message="'test-unit' failed" if="test.unit.failed"/>
|
---|
| 467 | </target>
|
---|
[16051] | 468 | <target name="test-it" depends="test-compile,create-revision" unless="test-it.notRequired"
|
---|
[9501] | 469 | description="Run integration tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
|
---|
| 470 | <call-junit testfamily="unit" testITsuffix="IT"/>
|
---|
| 471 | <call-junit testfamily="functional" testITsuffix="IT"/>
|
---|
| 472 | </target>
|
---|
[14141] | 473 | <target name="test-it-hardfail" depends="test-it" description="Run 'test-it' target but abort if tests failed">
|
---|
| 474 | <fail message="'test-it' failed">
|
---|
| 475 | <condition>
|
---|
| 476 | <or>
|
---|
| 477 | <isset property="test.unitIT.failed"/>
|
---|
| 478 | <isset property="test.functionalIT.failed"/>
|
---|
| 479 | </or>
|
---|
| 480 | </condition>
|
---|
| 481 | </fail>
|
---|
| 482 | </target>
|
---|
[12534] | 483 | <target name="test-perf" depends="test-compile" unless="test-perf.notRequired"
|
---|
| 484 | description="Run performance tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
|
---|
| 485 | <call-junit testfamily="performance" coverage="false"/>
|
---|
| 486 | </target>
|
---|
[14141] | 487 | <target name="test-perf-hardfail" depends="test-perf" description="Run 'test-perf' target but abort if tests failed">
|
---|
| 488 | <fail message="'test-perf' failed" if="test.performance.failed"/>
|
---|
| 489 | </target>
|
---|
[15703] | 490 | <target name="test-html" depends="test, test-it, test-perf" description="Generate HTML, CSV and XML test reports">
|
---|
[4166] | 491 | <!-- May require additional ant dependencies like ant-trax package -->
|
---|
| 492 | <junitreport todir="${test.dir}/report">
|
---|
| 493 | <fileset dir="${test.dir}/report">
|
---|
| 494 | <include name="TEST-*.xml"/>
|
---|
| 495 | </fileset>
|
---|
| 496 | <report todir="${test.dir}/report/html"/>
|
---|
| 497 | </junitreport>
|
---|
[6133] | 498 | <jacoco:report>
|
---|
| 499 | <executiondata>
|
---|
[11963] | 500 | <fileset dir="${test.dir}" includes="*.exec"/>
|
---|
[6133] | 501 | </executiondata>
|
---|
| 502 | <structure name="JOSM Test Coverage">
|
---|
| 503 | <classfiles>
|
---|
| 504 | <fileset dir="${build.dir}" includes="org/openstreetmap/"/>
|
---|
| 505 | </classfiles>
|
---|
| 506 | <sourcefiles encoding="UTF-8">
|
---|
| 507 | <fileset dir="${src.dir}" includes="org/openstreetmap/"/>
|
---|
| 508 | </sourcefiles>
|
---|
| 509 | </structure>
|
---|
[6134] | 510 | <html destdir="${test.dir}/report/jacoco"/>
|
---|
[15703] | 511 | <xml destfile="${test.dir}/report/jacoco.xml"/>
|
---|
| 512 | <csv destfile="${test.dir}/report/jacoco.csv"/>
|
---|
[6133] | 513 | </jacoco:report>
|
---|
[4166] | 514 | </target>
|
---|
[17895] | 515 | <!-- ProGuard does not woth with Java 17 yet: https://github.com/Guardsquare/proguard/issues/132 -->
|
---|
| 516 | <target name="dist-optimized" depends="dist" unless="isJava17" description="Build an optimized JOSM distribution file">
|
---|
[16243] | 517 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="proguard.classpath" conf="proguard"/>
|
---|
[16169] | 518 | <taskdef resource="proguard/ant/task.properties" classpathref="proguard.classpath"/>
|
---|
[4166] | 519 | <proguard>
|
---|
[12628] | 520 | -injars ${dist.jar}
|
---|
| 521 | -outjars ${dist-optimized.jar}
|
---|
[4166] | 522 |
|
---|
[14244] | 523 | -libraryjars ${java.home}/${java.library.dir}
|
---|
[4166] | 524 |
|
---|
[7367] | 525 | -dontoptimize
|
---|
| 526 | -dontobfuscate
|
---|
[16116] | 527 | -dontwarn org.jetbrains.annotations.**
|
---|
[4166] | 528 |
|
---|
[7367] | 529 | # These options probably are not necessary (and make processing a bit slower)
|
---|
| 530 | -dontskipnonpubliclibraryclasses
|
---|
| 531 | -dontskipnonpubliclibraryclassmembers
|
---|
[4166] | 532 |
|
---|
[7367] | 533 | -keepclasseswithmembers public class org.openstreetmap.josm.gui.MainApplication {
|
---|
| 534 | public static void main(java.lang.String[]);
|
---|
| 535 | }
|
---|
[4166] | 536 |
|
---|
[7367] | 537 | -keep class * extends org.openstreetmap.josm.io.FileImporter
|
---|
| 538 | -keep class * extends org.openstreetmap.josm.io.FileExporter
|
---|
| 539 | -keep class org.openstreetmap.josm.actions.search.SearchCompiler$Never
|
---|
[10949] | 540 | -keep class org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory$PseudoClasses {
|
---|
[8532] | 541 | static boolean *(org.openstreetmap.josm.gui.mappaint.Environment);
|
---|
| 542 | }
|
---|
[4166] | 543 |
|
---|
[7367] | 544 | -keepclassmembers enum * {
|
---|
| 545 | public static **[] values();
|
---|
| 546 | public static ** valueOf(java.lang.String);
|
---|
| 547 | }
|
---|
[4166] | 548 |
|
---|
[12873] | 549 | # Keep unused public classes and methods (needed for plugins)
|
---|
| 550 | -keep public class * {
|
---|
[7367] | 551 | public protected *;
|
---|
| 552 | }
|
---|
[4838] | 553 |
|
---|
[12873] | 554 | # Keep serialization code
|
---|
[10949] | 555 | -keepclassmembers class * implements java.io.Serializable {
|
---|
[16617] | 556 | static final long serialVersionUID;
|
---|
[12873] | 557 | private static final java.io.ObjectStreamField[] serialPersistentFields;
|
---|
[10949] | 558 | private void writeObject(java.io.ObjectOutputStream);
|
---|
| 559 | private void readObject(java.io.ObjectInputStream);
|
---|
[16617] | 560 | java.lang.Object writeReplace();
|
---|
[12873] | 561 | java.lang.Object readResolve();
|
---|
[10949] | 562 | }
|
---|
| 563 |
|
---|
[7367] | 564 | # Disable annoying [proguard] Note: the configuration keeps the entry point '...', but not the descriptor class '...'.
|
---|
| 565 | # This note should not be a problem as we don't use obfuscation
|
---|
| 566 | -dontnote
|
---|
[6133] | 567 | </proguard>
|
---|
[4166] | 568 | </target>
|
---|
[14244] | 569 | <target name="dist-optimized-report" depends="dist-optimized">
|
---|
[10845] | 570 | <!-- generate difference report between optimized jar and normal one -->
|
---|
| 571 | <exec executable="perl" dir="${basedir}">
|
---|
[13209] | 572 | <arg value="${tools.dir}/japicc/japi-compliance-checker.pl"/>
|
---|
[10845] | 573 | <arg value="--lib=JOSM"/>
|
---|
| 574 | <arg value="--keep-internal"/>
|
---|
| 575 | <arg value="--v1=${version.entry.commit.revision}"/>
|
---|
| 576 | <arg value="--v2=${version.entry.commit.revision}-optimized"/>
|
---|
| 577 | <arg value="--report-path=${dist.dir}/compat_report.html"/>
|
---|
[12628] | 578 | <arg value="${dist.jar}"/>
|
---|
| 579 | <arg value="${dist-optimized.jar}"/>
|
---|
[10845] | 580 | </exec>
|
---|
| 581 | </target>
|
---|
[14258] | 582 | <target name="check-plugins" depends="dist-optimized" description="Check of plugins binary compatibility" unless="isJava11">
|
---|
[4166] | 583 | <local name="dir"/>
|
---|
| 584 | <local name="plugins"/>
|
---|
| 585 | <property name="dir" value="plugin-check"/>
|
---|
[17544] | 586 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="animal.classpath" conf="animal"/>
|
---|
[4166] | 587 | <typedef uri="antlib:org.codehaus.mojo.animal_sniffer">
|
---|
[17544] | 588 | <classpath refid="animal.classpath"/>
|
---|
[4166] | 589 | </typedef>
|
---|
[13574] | 590 | <delete dir="${dir}" failonerror="false"/>
|
---|
[4166] | 591 | <mkdir dir="${dir}"/>
|
---|
| 592 | <!-- List of deprecated plugins -->
|
---|
[7133] | 593 | <loadfile property="deprecated-plugins" srcFile="${src.dir}/org/openstreetmap/josm/plugins/PluginHandler.java">
|
---|
[4166] | 594 | <filterchain>
|
---|
| 595 | <linecontains>
|
---|
| 596 | <contains value="new DeprecatedPlugin("/>
|
---|
| 597 | </linecontains>
|
---|
| 598 | <tokenfilter>
|
---|
| 599 | <replaceregex pattern=".*new DeprecatedPlugin\("(.+?)".*" replace="\1|" flags="gi"/>
|
---|
| 600 | </tokenfilter>
|
---|
| 601 | <striplinebreaks/>
|
---|
| 602 | <tokenfilter>
|
---|
| 603 | <replaceregex pattern="\|$" replace="" flags="gi"/>
|
---|
| 604 | </tokenfilter>
|
---|
| 605 | </filterchain>
|
---|
| 606 | </loadfile>
|
---|
[5498] | 607 | <!-- Download list of plugins -->
|
---|
[4166] | 608 | <loadresource property="plugins">
|
---|
[6955] | 609 | <url url="https://josm.openstreetmap.de/plugin"/>
|
---|
[4166] | 610 | <filterchain>
|
---|
| 611 | <linecontainsregexp negate="true">
|
---|
| 612 | <regexp pattern="^\t.*"/>
|
---|
| 613 | </linecontainsregexp>
|
---|
| 614 | <linecontainsregexp negate="true">
|
---|
| 615 | <regexp pattern="${deprecated-plugins}"/>
|
---|
| 616 | </linecontainsregexp>
|
---|
[14244] | 617 | <linecontainsregexp negate="true" unless:set="isJava10">
|
---|
[14383] | 618 | <!-- Skip javafx on Java 8/9, built for Java 10+ only -->
|
---|
| 619 | <regexp pattern="javafx.*"/>
|
---|
[14244] | 620 | </linecontainsregexp>
|
---|
[15234] | 621 | <linecontainsregexp negate="true" unless:set="isJava11">
|
---|
| 622 | <!-- Skip http2 on Java 8/9/10, built for Java 11+ only -->
|
---|
| 623 | <regexp pattern="http2.*"/>
|
---|
| 624 | </linecontainsregexp>
|
---|
[4166] | 625 | <tokenfilter>
|
---|
| 626 | <replaceregex pattern="^.*;" replace="" flags="gi"/>
|
---|
| 627 | </tokenfilter>
|
---|
| 628 | </filterchain>
|
---|
[6133] | 629 | </loadresource>
|
---|
| 630 | <!-- Delete files that are not in plugin list (like old plugins) -->
|
---|
| 631 | <loadresource property="file-list">
|
---|
| 632 | <propertyresource name="plugins"/>
|
---|
| 633 | <filterchain>
|
---|
| 634 | <tokenfilter>
|
---|
| 635 | <replaceregex pattern="^.*/(.*)$" replace="\1\|" flags=""/>
|
---|
| 636 | </tokenfilter>
|
---|
| 637 | <striplinebreaks/>
|
---|
| 638 | <tokenfilter>
|
---|
| 639 | <replaceregex pattern="\|$" replace="" flags="gi"/>
|
---|
[9765] | 640 | </tokenfilter>
|
---|
[6133] | 641 | </filterchain>
|
---|
| 642 | </loadresource>
|
---|
| 643 | <delete>
|
---|
| 644 | <restrict>
|
---|
| 645 | <fileset dir="${dir}"/>
|
---|
| 646 | <not>
|
---|
| 647 | <name regex="${file-list}"/>
|
---|
| 648 | </not>
|
---|
| 649 | </restrict>
|
---|
| 650 | </delete>
|
---|
| 651 | <!-- Download plugins -->
|
---|
[12874] | 652 | <copy todir="${dir}" flatten="true" verbose="true" failonerror="false">
|
---|
[4166] | 653 | <resourcelist>
|
---|
| 654 | <string value="${plugins}"/>
|
---|
| 655 | </resourcelist>
|
---|
| 656 | </copy>
|
---|
| 657 | <!-- Check plugins -->
|
---|
[5498] | 658 | <as:build-signatures destfile="${dir}/api.sig">
|
---|
| 659 | <path>
|
---|
[12628] | 660 | <fileset file="${dist-optimized.jar}"/>
|
---|
[14244] | 661 | <fileset file="${java.home}/lib/rt.jar" unless:set="isJava9"/>
|
---|
| 662 | <fileset file="${java.home}/lib/jce.jar" unless:set="isJava9"/>
|
---|
| 663 | <fileset file="${java.home}/lib/ext/jfxrt.jar" unless:set="isJava9"/>
|
---|
| 664 | <fileset dir="${java.home}/jmods" if:set="isJava9"/>
|
---|
[14997] | 665 | <fileset dir="/usr/share/openjfx/lib" unless:set="isJava9"/>
|
---|
[5498] | 666 | </path>
|
---|
[6133] | 667 | </as:build-signatures>
|
---|
[12873] | 668 | <as:check-signature signature="${dir}/api.sig" failonerror="false">
|
---|
[13711] | 669 | <ignore classname="afu.*"/>
|
---|
[13921] | 670 | <ignore classname="android.*"/>
|
---|
[12873] | 671 | <ignore classname="au.*"/>
|
---|
[7367] | 672 | <ignore classname="com.*"/>
|
---|
[12873] | 673 | <ignore classname="de.*"/>
|
---|
| 674 | <ignore classname="edu.*"/>
|
---|
| 675 | <ignore classname="groovy.*"/>
|
---|
[13962] | 676 | <ignore classname="io.*"/>
|
---|
[12873] | 677 | <ignore classname="it.*"/>
|
---|
[14167] | 678 | <ignore classname="java.lang.invoke.MethodHandle"/>
|
---|
[15639] | 679 | <ignore classname="java.nio.ByteBuffer"/>
|
---|
| 680 | <ignore classname="java.nio.FloatBuffer"/>
|
---|
[15387] | 681 | <ignore classname="java.util.list.kotlin.*"/>
|
---|
[7367] | 682 | <ignore classname="javax.*"/>
|
---|
[14245] | 683 | <ignore classname="jdk.swing.interop.*"/>
|
---|
[7367] | 684 | <ignore classname="jogamp.*"/>
|
---|
| 685 | <ignore classname="junit.*"/>
|
---|
[12873] | 686 | <ignore classname="kdu_jni.*"/>
|
---|
[15387] | 687 | <ignore classname="kotlin.*"/>
|
---|
[12873] | 688 | <ignore classname="net.*"/>
|
---|
| 689 | <ignore classname="netscape.*"/>
|
---|
| 690 | <ignore classname="nu.*"/>
|
---|
| 691 | <ignore classname="oracle.*"/>
|
---|
[7367] | 692 | <ignore classname="org.apache.*"/>
|
---|
[12873] | 693 | <ignore classname="org.bouncycastle.*"/>
|
---|
[13711] | 694 | <ignore classname="org.checkerframework.*"/>
|
---|
[7367] | 695 | <ignore classname="org.codehaus.*"/>
|
---|
[13921] | 696 | <ignore classname="org.conscrypt.*"/>
|
---|
[7367] | 697 | <ignore classname="org.dom4j.*"/>
|
---|
[12873] | 698 | <ignore classname="org.eclipse.*"/>
|
---|
| 699 | <ignore classname="org.ejml.*"/>
|
---|
[14164] | 700 | <ignore classname="org.fusesource.*"/>
|
---|
[12873] | 701 | <ignore classname="org.gdal.*"/>
|
---|
[15377] | 702 | <ignore classname="org.geotools.data.h2.*"/>
|
---|
| 703 | <ignore classname="org.geotools.gce.imagemosaic.*"/>
|
---|
[12873] | 704 | <ignore classname="org.hibernate.*"/>
|
---|
[7367] | 705 | <ignore classname="org.hsqldb.*"/>
|
---|
| 706 | <ignore classname="org.ibex.*"/>
|
---|
[7934] | 707 | <ignore classname="org.iso_relax.*"/>
|
---|
[7367] | 708 | <ignore classname="org.jaitools.*"/>
|
---|
| 709 | <ignore classname="org.jaxen.*"/>
|
---|
[12873] | 710 | <ignore classname="org.jboss.*"/>
|
---|
[14164] | 711 | <ignore classname="org.jctools.*"/>
|
---|
[13575] | 712 | <ignore classname="org.jdom.*"/>
|
---|
[7367] | 713 | <ignore classname="org.jdom2.*"/>
|
---|
[12873] | 714 | <ignore classname="org.jfree.*"/>
|
---|
[4166] | 715 | <ignore classname="org.jgraph.*"/>
|
---|
[12873] | 716 | <ignore classname="org.joda.*"/>
|
---|
[14164] | 717 | <ignore classname="org.json.*"/>
|
---|
[12873] | 718 | <ignore classname="org.junit.*"/>
|
---|
| 719 | <ignore classname="org.jvnet.*"/>
|
---|
[7367] | 720 | <ignore classname="org.kxml2.*"/>
|
---|
[15639] | 721 | <ignore classname="org.locationtech.*"/>
|
---|
[15462] | 722 | <ignore classname="org.mozilla.*"/>
|
---|
[8090] | 723 | <ignore classname="org.objectweb.*"/>
|
---|
[15387] | 724 | <ignore classname="org.opentest4j.*"/>
|
---|
[12873] | 725 | <ignore classname="org.osgi.*"/>
|
---|
| 726 | <ignore classname="org.postgresql.*"/>
|
---|
[7367] | 727 | <ignore classname="org.python.*"/>
|
---|
[12875] | 728 | <ignore classname="org.seasar.*"/>
|
---|
[7367] | 729 | <ignore classname="org.slf4j.*"/>
|
---|
[12873] | 730 | <ignore classname="org.springframework.*"/>
|
---|
| 731 | <ignore classname="org.testng.*"/>
|
---|
[13113] | 732 | <ignore classname="org.w3c.*"/>
|
---|
[12873] | 733 | <ignore classname="org.zeromq.*"/>
|
---|
[15540] | 734 | <ignore classname="waffle.*"/>
|
---|
[8173] | 735 | <!-- plugins used by another ones -->
|
---|
[7494] | 736 | <ignore classname="org.openstreetmap.josm.plugins.geotools.*"/>
|
---|
[14244] | 737 | <ignore classname="org.openstreetmap.josm.plugins.jaxb.*"/>
|
---|
[7934] | 738 | <ignore classname="org.openstreetmap.josm.plugins.jna.*"/>
|
---|
[7494] | 739 | <ignore classname="org.openstreetmap.josm.plugins.jts.*"/>
|
---|
| 740 | <ignore classname="org.openstreetmap.josm.plugins.log4j.*"/>
|
---|
[14244] | 741 | <ignore classname="org.openstreetmap.josm.plugins.openjfx.*"/>
|
---|
[7494] | 742 | <ignore classname="org.openstreetmap.josm.plugins.utilsplugin2.*"/>
|
---|
[12875] | 743 | <ignore classname="sun.*"/>
|
---|
[4166] | 744 | <path path="${dir}"/>
|
---|
| 745 | </as:check-signature>
|
---|
| 746 | </target>
|
---|
[4838] | 747 |
|
---|
[17338] | 748 | <target name="script-compile" depends="test-compile" description="Compile all scripts">
|
---|
[15033] | 749 | <javac sourcepath="" srcdir="${base.dir}/scripts" failonerror="true" includes="*.java"
|
---|
[17906] | 750 | destdir="${script-build.dir}" release="${java.lang.version}" debug="on"
|
---|
[16346] | 751 | includeantruntime="false" encoding="UTF-8">
|
---|
[15033] | 752 | <classpath>
|
---|
| 753 | <pathelement path="${build.dir}"/>
|
---|
| 754 | <pathelement path="${test.dir}/build/unit"/>
|
---|
| 755 | <pathelement path="${commons-lang3.jar}"/>
|
---|
| 756 | </classpath>
|
---|
[14636] | 757 | </javac>
|
---|
| 758 | </target>
|
---|
| 759 |
|
---|
[8687] | 760 | <macrodef name="_taginfo">
|
---|
| 761 | <attribute name="type"/>
|
---|
| 762 | <attribute name="output"/>
|
---|
| 763 | <sequential>
|
---|
| 764 | <echo message="Generating Taginfo for type @{type} to @{output}"/>
|
---|
[14636] | 765 | <java classname="TagInfoExtract" failonerror="true" fork="false">
|
---|
| 766 | <sysproperty key="java.awt.headless" value="true"/>
|
---|
| 767 | <classpath>
|
---|
[16126] | 768 | <pathelement path="${build.dir}"/>
|
---|
[15033] | 769 | <pathelement path="${script-build.dir}"/>
|
---|
| 770 | <pathelement path="${commons-lang3.jar}"/>
|
---|
[14636] | 771 | </classpath>
|
---|
| 772 | <arg value="--type"/>
|
---|
[8687] | 773 | <arg value="@{type}"/>
|
---|
| 774 | <arg value="--noexit"/>
|
---|
| 775 | <arg value="--imgurlprefix"/>
|
---|
[14636] | 776 | <arg value="http://josm.openstreetmap.de/download/taginfo/taginfo-img"/>
|
---|
| 777 | <arg value="--output"/>
|
---|
[8687] | 778 | <arg value="@{output}"/>
|
---|
[14636] | 779 | </java>
|
---|
[8687] | 780 | </sequential>
|
---|
| 781 | </macrodef>
|
---|
| 782 |
|
---|
[17338] | 783 | <target name="taginfo" depends="script-compile" description="Generate project files Taginfo">
|
---|
[9250] | 784 | <_taginfo type="mappaint" output="taginfo_style.json"/>
|
---|
| 785 | <_taginfo type="presets" output="taginfo_presets.json"/>
|
---|
| 786 | <_taginfo type="external_presets" output="taginfo_external_presets.json"/>
|
---|
[8687] | 787 | </target>
|
---|
| 788 |
|
---|
[17338] | 789 | <target name="imageryindex" depends="script-compile" description="Check editor imagery difference">
|
---|
[9505] | 790 | <echo message="Checking editor imagery difference"/>
|
---|
[15033] | 791 | <java classname="SyncEditorLayerIndex" failonerror="true" fork="false">
|
---|
| 792 | <classpath>
|
---|
[16126] | 793 | <pathelement path="${build.dir}"/>
|
---|
[15033] | 794 | <pathelement path="${script-build.dir}"/>
|
---|
| 795 | <pathelement path="${commons-lang3.jar}"/>
|
---|
| 796 | </classpath>
|
---|
| 797 | <arg value="--noeli"/>
|
---|
| 798 | <arg value="-p"/>
|
---|
| 799 | <arg value="imagery_eliout.imagery.xml"/>
|
---|
| 800 | <arg value="-q"/>
|
---|
| 801 | <arg value="imagery_josmout.imagery.xml"/>
|
---|
| 802 | </java>
|
---|
[9505] | 803 | </target>
|
---|
| 804 |
|
---|
[17338] | 805 | <target name="imageryindexdownload" description="Download and check editor imagery">
|
---|
[9505] | 806 | <exec append="false" executable="wget" failifexecutionfails="true">
|
---|
| 807 | <arg value="https://josm.openstreetmap.de/maps"/>
|
---|
| 808 | <arg value="-O"/>
|
---|
[11965] | 809 | <arg value="imagery_josm.imagery.xml"/>
|
---|
[9505] | 810 | <arg value="--unlink"/>
|
---|
| 811 | </exec>
|
---|
| 812 | <exec append="false" executable="wget" failifexecutionfails="true">
|
---|
[11238] | 813 | <arg value="https://josm.openstreetmap.de/wiki/ImageryCompareIgnores?format=txt"/>
|
---|
| 814 | <arg value="-O"/>
|
---|
[11965] | 815 | <arg value="imagery_josm.ignores.txt"/>
|
---|
[11238] | 816 | <arg value="--unlink"/>
|
---|
| 817 | </exec>
|
---|
| 818 | <exec append="false" executable="wget" failifexecutionfails="true">
|
---|
[16375] | 819 | <arg value="https://raw.githubusercontent.com/osmlab/editor-layer-index/gh-pages/imagery.geojson"/>
|
---|
[9505] | 820 | <arg value="-O"/>
|
---|
[11965] | 821 | <arg value="imagery_eli.geojson"/>
|
---|
[9505] | 822 | <arg value="--unlink"/>
|
---|
| 823 | </exec>
|
---|
| 824 | <antcall target="imageryindex"/>
|
---|
| 825 | </target>
|
---|
| 826 |
|
---|
[17338] | 827 | <target name="checkstyle-compile" depends="init" description="Compile Checkstyle rules">
|
---|
[16243] | 828 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="checkstyle.classpath" conf="checkstyle"/>
|
---|
[12582] | 829 | <mkdir dir="${checkstyle-build.dir}"/>
|
---|
[13209] | 830 | <javac sourcepath="" srcdir="${checkstyle.dir}/src" failonerror="true"
|
---|
[17906] | 831 | destdir="${checkstyle-build.dir}" release="${java.lang.version}" debug="on"
|
---|
[16346] | 832 | includeantruntime="false"
|
---|
[16171] | 833 | encoding="UTF-8" classpathref="checkstyle.classpath">
|
---|
[12582] | 834 | </javac>
|
---|
| 835 | </target>
|
---|
[17338] | 836 | <target name="checkstyle-changed" depends="checkstyle-compile" description="Run Checkstyle on SVN/Git-changed source files">
|
---|
[13303] | 837 | <exec append="false" osfamily="unix" executable="bash" failifexecutionfails="true">
|
---|
| 838 | <arg value="-c"/>
|
---|
[16171] | 839 | <arg value="(git ls-files src test --modified 2>/dev/null || svn status -q --ignore-externals src test) | grep -o '\(src\|test\)/.*' | xargs java -cp '${toString:checkstyle.classpath}:${checkstyle-build.dir}' com.puppycrawl.tools.checkstyle.Main -c ${checkstyle.dir}/josm_checks.xml | sed -e 's:\([^ ]*\) [^:]*/\([^:/]*.java\:[^:]*\):(\2)\1:'"/>
|
---|
[13303] | 840 | </exec>
|
---|
| 841 | <exec append="false" osfamily="windows" executable="powershell" failifexecutionfails="true">
|
---|
| 842 | <arg value="/c"/>
|
---|
[16171] | 843 | <arg value="svn status -q --ignore-externals src test | ForEach-Object {java -cp '${toString:checkstyle.classpath};${checkstyle-build.dir}' com.puppycrawl.tools.checkstyle.Main -c ${checkstyle.dir}/josm_checks.xml $_.split(' ')[7]}"/>
|
---|
[13303] | 844 | </exec>
|
---|
| 845 | </target>
|
---|
[17338] | 846 | <target name="checkstyle" depends="checkstyle-compile" description="Run Checkstyle on the source files">
|
---|
[16171] | 847 | <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties">
|
---|
| 848 | <classpath refid="checkstyle.classpath"/>
|
---|
| 849 | <classpath path="${checkstyle-build.dir}"/>
|
---|
| 850 | </taskdef>
|
---|
[13209] | 851 | <checkstyle config="${checkstyle.dir}/josm_checks.xml">
|
---|
[9765] | 852 | <fileset dir="${base.dir}/src/org/openstreetmap/josm" includes="**/*.java"
|
---|
[9250] | 853 | excludes="gui/mappaint/mapcss/parsergen/*.java"/>
|
---|
[9765] | 854 | <fileset dir="${base.dir}/test" includes="**/*.java"/>
|
---|
[14637] | 855 | <fileset dir="${base.dir}/scripts" includes="**/*.java"/>
|
---|
[11681] | 856 | <formatter type="plain"/>
|
---|
[8508] | 857 | <formatter type="xml" toFile="checkstyle-josm.xml"/>
|
---|
| 858 | </checkstyle>
|
---|
| 859 | </target>
|
---|
| 860 |
|
---|
[17338] | 861 | <target name="spotbugs" depends="dist" description="Run SpotBugs on the source files">
|
---|
[16243] | 862 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="spotbugs.classpath" conf="spotbugs"/>
|
---|
[16169] | 863 | <taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="spotbugs.classpath"/>
|
---|
[12801] | 864 | <spotbugs output="xml"
|
---|
| 865 | outputFile="spotbugs-josm.xml"
|
---|
[16166] | 866 | classpath="${toString:spotbugs.classpath}"
|
---|
[6133] | 867 | pluginList=""
|
---|
[13209] | 868 | excludeFilter="${spotbugs.dir}/josm-filter.xml"
|
---|
[16229] | 869 | onlyAnalyze="org.openstreetmap.josm.-"
|
---|
[6133] | 870 | effort="max"
|
---|
[10223] | 871 | reportLevel="low"
|
---|
[6133] | 872 | >
|
---|
[16229] | 873 | <class location="${dist.jar}" />
|
---|
[12801] | 874 | </spotbugs>
|
---|
[4838] | 875 | </target>
|
---|
[11713] | 876 |
|
---|
[17338] | 877 | <target name="pmd" depends="init" description="Run PMD on the source files">
|
---|
[16243] | 878 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="pmd.classpath" conf="pmd"/>
|
---|
[16169] | 879 | <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath"/>
|
---|
[13209] | 880 | <pmd shortFilenames="true" cacheLocation="${pmd.dir}/cache" encoding="UTF-8">
|
---|
[12628] | 881 | <sourceLanguage name="java" version="${java.lang.version}" />
|
---|
[13209] | 882 | <ruleset>${pmd.dir}/josm-ruleset.xml</ruleset>
|
---|
[11713] | 883 | <formatter type="text" toConsole="true" />
|
---|
| 884 | <formatter type="xml" toFile="pmd-josm.xml">
|
---|
| 885 | <param name="encoding" value="UTF-8" />
|
---|
| 886 | </formatter>
|
---|
| 887 | <fileset dir="${src.dir}">
|
---|
| 888 | <include name="org/openstreetmap/josm/**/*.java"/>
|
---|
| 889 | <exclude name="org/openstreetmap/josm/gui/mappaint/mapcss/parsergen/*.java" />
|
---|
| 890 | </fileset>
|
---|
[14638] | 891 | <fileset dir="${base.dir}/scripts" includes="**/*.java"/>
|
---|
[11713] | 892 | </pmd>
|
---|
| 893 | </target>
|
---|
| 894 |
|
---|
[17338] | 895 | <target name="run" depends="dist" description="Run JOSM">
|
---|
[12628] | 896 | <java jar="${dist.jar}" fork="true">
|
---|
[5323] | 897 | <arg value="--set=expert=true"/>
|
---|
[15797] | 898 | <arg value="--set=iso.dates=true"/>
|
---|
[5323] | 899 | <jvmarg value="-Djosm.home=/tmp/.josm/"/>
|
---|
| 900 | </java>
|
---|
| 901 | </target>
|
---|
[17338] | 902 | <target name="epsg-compile" depends="init"
|
---|
| 903 | description="Compile build script for generating projection list">
|
---|
[9765] | 904 | <property name="proj-classpath" location="${build.dir}"/>
|
---|
| 905 | <mkdir dir="${proj-build.dir}"/>
|
---|
[13794] | 906 | <javac sourcepath="" srcdir="${base.dir}/scripts" failonerror="true" includes="BuildProjectionDefinitions.java"
|
---|
[17906] | 907 | destdir="${proj-build.dir}" release="${java.lang.version}" debug="on"
|
---|
[16346] | 908 | includeantruntime="false"
|
---|
[9765] | 909 | encoding="UTF-8" classpath="${proj-classpath}">
|
---|
[9133] | 910 | </javac>
|
---|
| 911 | </target>
|
---|
[17338] | 912 | <target name="epsg" unless="epsg.notRequired" depends="epsg-compile"
|
---|
| 913 | description="Generate projection list">
|
---|
[13236] | 914 | <touch file="${epsg.output}" mkdirs="true"/>
|
---|
[10259] | 915 | <java classname="BuildProjectionDefinitions" failonerror="true" fork="true">
|
---|
[9735] | 916 | <sysproperty key="java.awt.headless" value="true"/>
|
---|
[9133] | 917 | <classpath>
|
---|
[16140] | 918 | <pathelement path="${resources.dir}"/>
|
---|
[9765] | 919 | <pathelement path="${proj-classpath}"/>
|
---|
| 920 | <pathelement path="${proj-build.dir}"/>
|
---|
[9133] | 921 | </classpath>
|
---|
[9765] | 922 | <arg value="${base.dir}"/>
|
---|
[9133] | 923 | </java>
|
---|
| 924 | </target>
|
---|
[17338] | 925 | <target name="update-proj-files" depends="test-compile"
|
---|
| 926 | description="Update projection test files after an update of projection definitions">
|
---|
[14568] | 927 | <java classname="org.openstreetmap.josm.data.projection.ProjectionRefTest" failonerror="true" fork="true">
|
---|
| 928 | <classpath>
|
---|
| 929 | <path refid="test.classpath"/>
|
---|
| 930 | <pathelement path="${test.dir}/build/unit"/>
|
---|
| 931 | </classpath>
|
---|
| 932 | </java>
|
---|
| 933 | <java classname="org.openstreetmap.josm.data.projection.ProjectionRegressionTest" failonerror="true" fork="true">
|
---|
| 934 | <classpath>
|
---|
| 935 | <path refid="test.classpath"/>
|
---|
| 936 | <pathelement path="${test.dir}/build/unit"/>
|
---|
| 937 | </classpath>
|
---|
| 938 | </java>
|
---|
| 939 | </target>
|
---|
[17338] | 940 | <target name="jdeps" depends="compile" description="Generate jdeps dependency graph">
|
---|
[14136] | 941 | <delete dir="${modules.dir}"/>
|
---|
| 942 | <mkdir dir="${modules.dir}"/>
|
---|
| 943 | <!-- JOSM only -->
|
---|
| 944 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-actions.jar" includes="org/openstreetmap/josm/actions/**/*.class"/>
|
---|
| 945 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-cli.jar" includes="org/openstreetmap/josm/cli/**/*.class"/>
|
---|
| 946 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-command.jar" includes="org/openstreetmap/josm/command/**/*.class"/>
|
---|
| 947 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-data.jar" includes="org/openstreetmap/josm/data/**/*.class"/>
|
---|
| 948 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-gui.jar" includes="org/openstreetmap/josm/gui/**/*.class"/>
|
---|
| 949 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-io.jar" includes="org/openstreetmap/josm/io/**/*.class"/>
|
---|
| 950 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-plugins.jar" includes="org/openstreetmap/josm/plugins/**/*.class"/>
|
---|
| 951 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-spi.jar" includes="org/openstreetmap/josm/spi/**/*.class"/>
|
---|
| 952 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-tools.jar" includes="org/openstreetmap/josm/tools/**/*.class"/>
|
---|
| 953 | <exec executable="jdeps" dir="${modules.dir}">
|
---|
[16050] | 954 | <arg line="-f 'java.*|org.xml.*|org.w3c.*|sun.*|com.*|oauth.*|org.apache.*|org.glassfish.*|org.openstreetmap.gui.*'"/>
|
---|
[14136] | 955 | <arg line="-dotoutput dots *.jar"/>
|
---|
| 956 | </exec>
|
---|
| 957 | <exec executable="dot" dir="${modules.dir}/dots">
|
---|
| 958 | <arg line="-O -Tpng summary.dot"/>
|
---|
| 959 | </exec>
|
---|
| 960 | <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-without-dependencies.png"/>
|
---|
| 961 | <!-- Direct dependencies -->
|
---|
[16050] | 962 | <copy todir="${modules.dir}" flatten="true">
|
---|
| 963 | <fileset refid="runtime.fileset" />
|
---|
| 964 | </copy>
|
---|
[14136] | 965 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/svgSalamander.jar" includes="com/kitfox/**/*.class"/>
|
---|
| 966 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/oauth-signpost.jar" includes="oauth/**/*.class"/>
|
---|
[16399] | 967 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/commons-jcs.jar" includes="org/apache/commons/jcs3/**/*.class"/>
|
---|
[14136] | 968 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/jmapviewer.jar" includes="org/openstreetmap/gui/**/*.class"/>
|
---|
| 969 | <exec executable="jdeps" dir="${modules.dir}">
|
---|
[16408] | 970 | <arg line="-f 'java.*|org.xml.*|org.w3c.*|sun.*|com.sun.*|com.google.*|org.tukaani.*'"/>
|
---|
[14136] | 971 | <arg line="-dotoutput dots *.jar"/>
|
---|
| 972 | </exec>
|
---|
| 973 | <exec executable="dot" dir="${modules.dir}/dots">
|
---|
| 974 | <arg line="-O -Tpng summary.dot"/>
|
---|
| 975 | </exec>
|
---|
| 976 | <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-with-direct-dependencies.png"/>
|
---|
| 977 | <!-- All dependencies -->
|
---|
| 978 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/google-gdata.jar" includes="com/google/**/*.class"/>
|
---|
| 979 | <exec executable="jdeps" dir="${modules.dir}">
|
---|
| 980 | <arg line="-dotoutput dots *.jar"/>
|
---|
| 981 | </exec>
|
---|
| 982 | <exec executable="dot" dir="${modules.dir}/dots">
|
---|
| 983 | <arg line="-O -Tpng summary.dot"/>
|
---|
| 984 | </exec>
|
---|
| 985 | <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-with-all-dependencies.png"/>
|
---|
| 986 | </target>
|
---|
[16050] | 987 | <target name="resolve" depends="init-ivy" unless="resolve.notRequired" description="Resolve Ivy dependencies">
|
---|
[16125] | 988 | <ivy:settings file="${base.dir}/ivysettings.xml"/>
|
---|
[16243] | 989 | <ivy:resolve log="download-only" file="${base.dir}/ivy.xml" keep="true"/>
|
---|
| 990 | <ivy:cachepath log="download-only" pathid="compile.path" conf="compile"/>
|
---|
| 991 | <ivy:cachepath log="download-only" pathid="runtime.path" conf="runtime"/>
|
---|
| 992 | <ivy:cachefileset log="download-only" setid="runtime.fileset" conf="runtime"/>
|
---|
| 993 | <ivy:cachepath log="download-only" pathid="test.path" conf="test"/>
|
---|
[15977] | 994 | </target>
|
---|
[17338] | 995 | <target name="extract-libraries" depends="resolve" description="Extract libraries to build dir">
|
---|
[16002] | 996 | <unzip dest="${build.dir}">
|
---|
| 997 | <fileset refid="runtime.fileset"/>
|
---|
| 998 | <patternset>
|
---|
[16397] | 999 | <exclude name="META-INF/*"/>
|
---|
| 1000 | <exclude name="META-INF/maven/**"/>
|
---|
[17644] | 1001 | <exclude name="META-INF/resources/webjars/tag2link/*/LICENSE"/>
|
---|
| 1002 | <exclude name="META-INF/resources/webjars/tag2link/*/README.md"/>
|
---|
| 1003 | <exclude name="META-INF/resources/webjars/tag2link/*/build.js"/>
|
---|
| 1004 | <exclude name="META-INF/resources/webjars/tag2link/*/package.json"/>
|
---|
| 1005 | <exclude name="META-INF/resources/webjars/tag2link/*/schema.json"/>
|
---|
| 1006 | <exclude name="META-INF/resources/webjars/tag2link/*/tag2link.sophox.sparql"/>
|
---|
| 1007 | <exclude name="META-INF/resources/webjars/tag2link/*/tag2link.wikidata.sparql"/>
|
---|
[16397] | 1008 | <exclude name="META-INF/versions/**"/>
|
---|
[16002] | 1009 | <exclude name="*"/>
|
---|
[16194] | 1010 | <exclude name="org/openstreetmap/gui/jmapviewer/Demo*"/>
|
---|
[16027] | 1011 | <exclude name="com/drew/imaging/FileTypeDetector*"/>
|
---|
| 1012 | <exclude name="com/drew/imaging/ImageMetadataReader*"/>
|
---|
[16025] | 1013 | <exclude name="com/drew/imaging/avi/**"/>
|
---|
| 1014 | <exclude name="com/drew/imaging/bmp/**"/>
|
---|
| 1015 | <exclude name="com/drew/imaging/eps/**"/>
|
---|
| 1016 | <exclude name="com/drew/imaging/gif/**"/>
|
---|
| 1017 | <exclude name="com/drew/imaging/heif/**"/>
|
---|
| 1018 | <exclude name="com/drew/imaging/ico/**"/>
|
---|
| 1019 | <exclude name="com/drew/imaging/mp3/**"/>
|
---|
| 1020 | <exclude name="com/drew/imaging/mp4/**"/>
|
---|
| 1021 | <exclude name="com/drew/imaging/pcx/**"/>
|
---|
| 1022 | <exclude name="com/drew/imaging/psd/**"/>
|
---|
| 1023 | <exclude name="com/drew/imaging/quicktime/**"/>
|
---|
| 1024 | <exclude name="com/drew/imaging/raf/**"/>
|
---|
| 1025 | <exclude name="com/drew/imaging/riff/**"/>
|
---|
| 1026 | <exclude name="com/drew/imaging/wav/**"/>
|
---|
| 1027 | <exclude name="com/drew/imaging/webp/**"/>
|
---|
| 1028 | <exclude name="com/drew/metadata/avi/**"/>
|
---|
| 1029 | <exclude name="com/drew/metadata/bmp/**"/>
|
---|
| 1030 | <exclude name="com/drew/metadata/eps/**"/>
|
---|
| 1031 | <exclude name="com/drew/metadata/gif/**"/>
|
---|
| 1032 | <exclude name="com/drew/metadata/heif/**"/>
|
---|
| 1033 | <exclude name="com/drew/metadata/ico/**"/>
|
---|
| 1034 | <exclude name="com/drew/metadata/mov/**"/>
|
---|
| 1035 | <exclude name="com/drew/metadata/mp3/**"/>
|
---|
| 1036 | <exclude name="com/drew/metadata/mp4/**"/>
|
---|
| 1037 | <exclude name="com/drew/metadata/pcx/**"/>
|
---|
| 1038 | <exclude name="com/drew/metadata/wav/**"/>
|
---|
| 1039 | <exclude name="com/drew/metadata/webp/**"/>
|
---|
| 1040 | <exclude name="com/drew/tools/**"/>
|
---|
[16026] | 1041 | <exclude name="org/apache/commons/compress/PasswordRequiredException*"/>
|
---|
[16023] | 1042 | <exclude name="org/apache/commons/compress/archivers/**"/>
|
---|
| 1043 | <exclude name="org/apache/commons/compress/changes/**"/>
|
---|
[16026] | 1044 | <exclude name="org/apache/commons/compress/compressors/bzip2/BZip2Utils*"/>
|
---|
[16023] | 1045 | <exclude name="org/apache/commons/compress/compressors/brotli/**"/>
|
---|
[16026] | 1046 | <exclude name="org/apache/commons/compress/compressors/CompressorStreamFactory*"/>
|
---|
| 1047 | <exclude name="org/apache/commons/compress/compressors/CompressorStreamProvider*"/>
|
---|
| 1048 | <exclude name="org/apache/commons/compress/compressors/CompressorException*"/>
|
---|
| 1049 | <exclude name="org/apache/commons/compress/compressors/FileNameUtil*"/>
|
---|
[16023] | 1050 | <exclude name="org/apache/commons/compress/compressors/deflate/**"/>
|
---|
| 1051 | <exclude name="org/apache/commons/compress/compressors/gzip/**"/>
|
---|
| 1052 | <exclude name="org/apache/commons/compress/compressors/lz4/**"/>
|
---|
| 1053 | <exclude name="org/apache/commons/compress/compressors/lzma/**"/>
|
---|
| 1054 | <exclude name="org/apache/commons/compress/compressors/lz77support/**"/>
|
---|
| 1055 | <exclude name="org/apache/commons/compress/compressors/pack200/**"/>
|
---|
| 1056 | <exclude name="org/apache/commons/compress/compressors/snappy/**"/>
|
---|
[16026] | 1057 | <exclude name="org/apache/commons/compress/compressors/xz/XZUtils*"/>
|
---|
[16023] | 1058 | <exclude name="org/apache/commons/compress/compressors/z/**"/>
|
---|
| 1059 | <exclude name="org/apache/commons/compress/compressors/zstandard/**"/>
|
---|
| 1060 | <exclude name="org/apache/commons/compress/parallel/**"/>
|
---|
[16026] | 1061 | <exclude name="org/apache/commons/compress/utils/ArchiveUtils*"/>
|
---|
[16399] | 1062 | <exclude name="org/apache/commons/jcs3/auxiliary/disk/jdbc/**"/>
|
---|
| 1063 | <exclude name="org/apache/commons/jcs3/auxiliary/remote/http/client/**"/>
|
---|
| 1064 | <exclude name="org/apache/commons/jcs3/auxiliary/remote/http/server/RemoteHttpCacheServlet*"/>
|
---|
| 1065 | <exclude name="org/apache/commons/jcs3/auxiliary/remote/server/RemoteCacheStartupServlet*"/>
|
---|
| 1066 | <exclude name="org/apache/commons/jcs3/log/Log4j2Factory*"/>
|
---|
| 1067 | <exclude name="org/apache/commons/jcs3/log/Log4j2LogAdapter*"/>
|
---|
| 1068 | <exclude name="org/apache/commons/jcs3/utils/servlet/**"/>
|
---|
[16002] | 1069 | </patternset>
|
---|
| 1070 | </unzip>
|
---|
| 1071 | </target>
|
---|
[17338] | 1072 | <target name="sources" description="Generate jar file of JOSM source files and its dependencies" depends="init,epsg,resolve">
|
---|
[16243] | 1073 | <ivy:cachefileset log="download-only" setid="sources.fileset" conf="sources"/>
|
---|
[16141] | 1074 | <jar destfile="${dist-sources.jar}" level="${clevel}">
|
---|
| 1075 | <zipgroupfileset refid="sources.fileset"/>
|
---|
[16350] | 1076 | <fileset dir="${src.dir}"/>
|
---|
[16141] | 1077 | <fileset dir="${resources.dir}"/>
|
---|
| 1078 | </jar>
|
---|
| 1079 | </target>
|
---|
[15977] | 1080 | <target name="bootstrap-workspace" description="Copy libraries from ivy cache to workspace folders for IDE" depends="resolve">
|
---|
| 1081 | <delete dir="${lib.dir}"/>
|
---|
[16229] | 1082 | <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[type].[ext]" conf="compile,runtime,sources,test"/>
|
---|
[16556] | 1083 | <ivy:retrieve pattern="${lib.dir}/tools/[artifact]-[type].[ext]" conf="javacc,checkstyle,pmd,spotbugs,errorprone" file="${tools.ivy}"/>
|
---|
[15977] | 1084 | </target>
|
---|
[17338] | 1085 | <target name="ivy-report" description="Generate Ivy reports of dependency resolving" depends="resolve">
|
---|
[16243] | 1086 | <ivy:report todir="${tools.dir}/ivy-report" graph="false"/>
|
---|
| 1087 | </target>
|
---|
[16898] | 1088 | <target name="ivy-checkdepsupdate" description="Display dependency updates on the console" depends="resolve">
|
---|
| 1089 | <ivy:checkdepsupdate/>
|
---|
| 1090 | </target>
|
---|
[16229] | 1091 | <target name="api-dependency-tree" description="Displays Ivy dependency tree for JOSM API" depends="resolve">
|
---|
| 1092 | <ivy:dependencytree conf="api"/>
|
---|
| 1093 | </target>
|
---|
| 1094 | <target name="test-dependency-tree" description="Displays Ivy dependency tree for JOSM tests" depends="resolve">
|
---|
| 1095 | <ivy:dependencytree conf="test"/>
|
---|
| 1096 | </target>
|
---|
[4166] | 1097 | </project>
|
---|