[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"/>
|
---|
[12628] | 71 | <property name="java.lang.version" value="1.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>
|
---|
[7001] | 179 | <!-- Mac OS X target -->
|
---|
[16878] | 180 | <target name="mac" depends="init">
|
---|
[6217] | 181 | <!-- Using https://bitbucket.org/infinitekind/appbundler to create mac application bundle -->
|
---|
[14793] | 182 | <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="${tools.dir}/appbundler.jar"/>
|
---|
[6217] | 183 | <!-- create MacOS X application bundle -->
|
---|
[6945] | 184 | <bundleapp outputdirectory="${bundle.outdir}" name="JOSM" displayname="JOSM" executablename="JOSM" identifier="org.openstreetmap.josm"
|
---|
[6216] | 185 | mainclassname="org.openstreetmap.josm.gui.MainApplication"
|
---|
[6217] | 186 | copyright="JOSM, and all its integral parts, are released under the GNU General Public License v2 or later"
|
---|
[6216] | 187 | applicationCategory="public.app-category.utilities"
|
---|
| 188 | shortversion="${version.entry.commit.revision} SVN"
|
---|
| 189 | version="${version.entry.commit.revision} SVN"
|
---|
[17236] | 190 | icon="native/macosx/JOSM.icns"
|
---|
[6217] | 191 | highResolutionCapable="true">
|
---|
[6216] | 192 |
|
---|
| 193 | <arch name="x86_64"/>
|
---|
| 194 | <arch name="i386"/>
|
---|
| 195 |
|
---|
[6945] | 196 | <classpath file="${bundle.jar}"/>
|
---|
[6216] | 197 |
|
---|
[13722] | 198 | <option value="-Xmx2048m"/>
|
---|
[6216] | 199 |
|
---|
| 200 | <option value="-Xdock:icon=Contents/Resources/JOSM.icns"/>
|
---|
| 201 | <option value="-Xdock:name=JOSM"/>
|
---|
| 202 |
|
---|
| 203 | <!-- OSX specific options, optional -->
|
---|
| 204 | <option value="-Dapple.laf.useScreenMenuBar=true"/>
|
---|
| 205 | <option value="-Dcom.apple.macos.use-file-dialog-packages=true"/>
|
---|
| 206 | <option value="-Dcom.apple.macos.useScreenMenuBar=true"/>
|
---|
| 207 | <option value="-Dcom.apple.mrj.application.apple.menu.about.name=JOSM"/>
|
---|
| 208 | <option value="-Dcom.apple.smallTabs=true"/>
|
---|
| 209 | </bundleapp>
|
---|
[9765] | 210 |
|
---|
[6217] | 211 | <!-- appbundler lacks the possibility of defining our own keys or using a template, so update the .plist manually -->
|
---|
[13209] | 212 | <taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" classpath="${tools.dir}/xmltask.jar"/>
|
---|
[9765] | 213 |
|
---|
[6945] | 214 | <xmltask source="${bundle.outdir}/JOSM.app/Contents/Info.plist" dest="${bundle.outdir}/JOSM.app/Contents/Info.plist" indent="false">
|
---|
[7367] | 215 | <!-- remove empty CFBundleDocumentTypes definition -->
|
---|
| 216 | <remove path="/plist/dict/key[text()='CFBundleDocumentTypes']|/plist/dict/key[text()='CFBundleDocumentTypes']/following-sibling::array[1]"/>
|
---|
[7287] | 217 | <!-- insert our own keys -->
|
---|
[16007] | 218 | <insert position="before" path="/plist/dict/key[1]" file="native/macosx/JOSM.app/Contents/Info.plist_template.xml" />
|
---|
[6217] | 219 | </xmltask>
|
---|
[9765] | 220 |
|
---|
[6216] | 221 | <!-- create ZIP file with MacOS X application bundle -->
|
---|
[7001] | 222 | <zip destfile="${bundle.outdir}/josm-custom-macosx.zip" update="true">
|
---|
[6945] | 223 | <zipfileset dir="." includes="CONTRIBUTION README LICENSE"/>
|
---|
| 224 | <zipfileset dir="${bundle.outdir}" includes="JOSM.app/**/*" filemode="755" />
|
---|
[6216] | 225 | </zip>
|
---|
[6217] | 226 | </target>
|
---|
[7001] | 227 | <target name="distmac" depends="dist">
|
---|
| 228 | <antcall target="mac">
|
---|
[9765] | 229 | <param name="bundle.outdir" value="${dist.dir}"/>
|
---|
[12628] | 230 | <param name="bundle.jar" value="${dist.jar}"/>
|
---|
[6945] | 231 | </antcall>
|
---|
| 232 | </target>
|
---|
[7839] | 233 | <!-- Windows target -->
|
---|
| 234 | <target name="distwin" depends="dist">
|
---|
[16007] | 235 | <exec dir="native/windows" executable="./josm-setup-unix.sh">
|
---|
[7839] | 236 | <arg value="${version.entry.commit.revision}"/>
|
---|
[12628] | 237 | <arg value="${dist.jar}"/>
|
---|
[7839] | 238 | </exec>
|
---|
| 239 | </target>
|
---|
[17338] | 240 | <target name="javacc" depends="init" unless="javacc.notRequired" description="Compile the MapCSS compiler">
|
---|
[16243] | 241 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="javacc.classpath" conf="javacc"/>
|
---|
[4252] | 242 | <mkdir dir="${mapcss.dir}/parsergen"/>
|
---|
[11676] | 243 | <java classname="javacc" fork="true" failonerror="true">
|
---|
[16908] | 244 | <classpath path="${tools.dir}/javacc"/>
|
---|
[16168] | 245 | <classpath refid="javacc.classpath"/>
|
---|
[7043] | 246 | <arg value="-DEBUG_PARSER=false"/>
|
---|
| 247 | <arg value="-DEBUG_TOKEN_MANAGER=false"/>
|
---|
[12628] | 248 | <arg value="-JDK_VERSION=${java.lang.version}"/>
|
---|
[6446] | 249 | <arg value="-GRAMMAR_ENCODING=UTF-8"/>
|
---|
[4257] | 250 | <arg value="-OUTPUT_DIRECTORY=${mapcss.dir}/parsergen"/>
|
---|
| 251 | <arg value="${mapcss.dir}/MapCSSParser.jj"/>
|
---|
[11676] | 252 | </java>
|
---|
[4252] | 253 | </target>
|
---|
[17338] | 254 | <target name="compile-cots" depends="init" description="Compile third-party dependencies not retrieved with Ivy">
|
---|
[7068] | 255 | <!-- COTS -->
|
---|
[16537] | 256 | <javac srcdir="${src.dir}" includes="com/kitfox/**" excludes="**/package-info.java" nowarn="on" encoding="iso-8859-1"
|
---|
[16346] | 257 | destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeAntRuntime="false">
|
---|
[7019] | 258 | <!-- get rid of "internal proprietary API" warning -->
|
---|
[7068] | 259 | <compilerarg value="-XDignore.symbol.file"/>
|
---|
[16050] | 260 | <classpath>
|
---|
| 261 | <path refid="runtime.path"/>
|
---|
| 262 | </classpath>
|
---|
[7019] | 263 | </javac>
|
---|
[12648] | 264 | </target>
|
---|
[17338] | 265 | <target name="compile" depends="init,javacc,compile-cots" unless="compile.notRequired" description="Compile JOSM">
|
---|
[16556] | 266 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="errorprone.classpath" conf="errorprone"/>
|
---|
[16571] | 267 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="errorprone_javac.classpath" conf="errorprone_javac"/>
|
---|
[8526] | 268 | <!-- JOSM -->
|
---|
[14222] | 269 | <javac sourcepath="" srcdir="${src.dir}" fork="yes"
|
---|
[16556] | 270 | excludes="com/**,org/apache/commons/**,**/package-info.java"
|
---|
[16346] | 271 | destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeantruntime="false" encoding="UTF-8">
|
---|
[16571] | 272 | <compilerarg value="-J-Xbootclasspath/p:${toString:errorprone_javac.classpath}" unless:set="isJava9"/>
|
---|
[17520] | 273 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 274 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 275 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 276 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 277 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 278 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 279 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 280 | <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
| 281 | <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
|
---|
[14222] | 282 | <compilerarg line="-XDcompilePolicy=simple"/>
|
---|
| 283 | <compilerarg value="-processorpath"/>
|
---|
[16556] | 284 | <compilerarg pathref="errorprone.classpath"/>
|
---|
[8526] | 285 | <compilerarg value="-Xlint:cast"/>
|
---|
| 286 | <compilerarg value="-Xlint:deprecation"/>
|
---|
| 287 | <compilerarg value="-Xlint:dep-ann"/>
|
---|
| 288 | <compilerarg value="-Xlint:divzero"/>
|
---|
| 289 | <compilerarg value="-Xlint:empty"/>
|
---|
| 290 | <compilerarg value="-Xlint:finally"/>
|
---|
| 291 | <compilerarg value="-Xlint:overrides"/>
|
---|
| 292 | <!--<compilerarg value="-Xlint:rawtypes"/>-->
|
---|
| 293 | <compilerarg value="-Xlint:static"/>
|
---|
| 294 | <compilerarg value="-Xlint:try"/>
|
---|
| 295 | <compilerarg value="-Xlint:unchecked"/>
|
---|
| 296 | <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
|
---|
| 297 | <compilerarg value="-XDignore.symbol.file"/>
|
---|
[17515] | 298 | <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" unless:set="noErrorProne"/>
|
---|
[10659] | 299 | <compilerarg line="-Xmaxwarns 1000"/>
|
---|
[15977] | 300 | <classpath>
|
---|
| 301 | <path refid="runtime.path"/>
|
---|
| 302 | </classpath>
|
---|
[8526] | 303 | </javac>
|
---|
[16036] | 304 | </target>
|
---|
[16349] | 305 | <target name="create-resources" depends="create-revision" description="Create generated resource files">
|
---|
| 306 | <copy todir="${resources.dir}">
|
---|
| 307 | <file file="CONTRIBUTION"/>
|
---|
| 308 | <file file="README"/>
|
---|
| 309 | <file file="LICENSE"/>
|
---|
| 310 | </copy>
|
---|
| 311 | </target>
|
---|
| 312 | <target name="copy-resources" depends="create-resources" description="Copy resource files to build directory">
|
---|
[6756] | 313 | <copy todir="build" failonerror="no" includeemptydirs="no">
|
---|
[16140] | 314 | <fileset dir="${resources.dir}"/>
|
---|
[6756] | 315 | </copy>
|
---|
[4166] | 316 | </target>
|
---|
[17338] | 317 | <target name="init" depends="init-properties,resolve" description="Initialize the build">
|
---|
[5392] | 318 | <uptodate property="javacc.notRequired" targetfile="${mapcss.dir}/parsergen/MapCSSParser.java" >
|
---|
| 319 | <srcfiles dir="${mapcss.dir}" includes="MapCSSParser.jj"/>
|
---|
| 320 | </uptodate>
|
---|
[16345] | 321 | <uptodate property="epsg.notRequired" targetfile="${epsg.output}">
|
---|
| 322 | <srcfiles file="${base.dir}/scripts/BuildProjectionDefinitions.java"/>
|
---|
| 323 | <srcfiles dir="nodist/data/projection"/>
|
---|
| 324 | </uptodate>
|
---|
[9765] | 325 | <mkdir dir="${build.dir}"/>
|
---|
| 326 | <mkdir dir="${dist.dir}"/>
|
---|
[4166] | 327 | </target>
|
---|
[17338] | 328 | <target name="javadoc" depends="init" description="Generate API documentation from JOSM source files">
|
---|
[9765] | 329 | <javadoc destdir="javadoc"
|
---|
[7133] | 330 | sourcepath="${src.dir}"
|
---|
[15992] | 331 | classpathref="compile.path"
|
---|
[9765] | 332 | encoding="UTF-8"
|
---|
[16194] | 333 | packagenames="org.openstreetmap.josm.*"
|
---|
[9250] | 334 | excludepackagenames="org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.*"
|
---|
[5263] | 335 | windowtitle="JOSM"
|
---|
| 336 | use="true"
|
---|
[5481] | 337 | private="true"
|
---|
[5263] | 338 | linksource="true"
|
---|
| 339 | author="false">
|
---|
[15106] | 340 | <link href="https://docs.oracle.com/javase/8/docs/api" unless:set="isJava11" />
|
---|
| 341 | <link href="https://docs.oracle.com/en/java/javase/11/docs/api" if:set="isJava11" />
|
---|
[16348] | 342 | <doctitle><![CDATA[<h2>
|
---|
| 343 | <img src="https://josm.openstreetmap.de/svn/trunk/nodist/images/logo/header.png" style="vertical-align: middle;" alt="JOSM">
|
---|
| 344 | — Javadoc
|
---|
| 345 | </h2>]]></doctitle>
|
---|
[6955] | 346 | <bottom><![CDATA[<a href="https://josm.openstreetmap.de/">JOSM</a>]]></bottom>
|
---|
[15243] | 347 | <!-- Disable HTML checking until we switch to Java13+, see https://bugs.openjdk.java.net/browse/JDK-8223552 -->
|
---|
| 348 | <arg value="-Xdoclint:-html" if:set="isJava13" />
|
---|
[13494] | 349 | <arg value="-html5" if:set="isJava9" />
|
---|
[13820] | 350 | <arg value="--add-exports" if:set="isJava9" unless:set="noJavaFX" />
|
---|
| 351 | <arg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" if:set="isJava9" unless:set="noJavaFX" />
|
---|
[5263] | 352 | </javadoc>
|
---|
| 353 | </target>
|
---|
[17338] | 354 | <target name="clean" depends="init-properties" description="Delete all build files">
|
---|
[9765] | 355 | <delete dir="${build.dir}"/>
|
---|
| 356 | <delete dir="${proj-build.dir}"/>
|
---|
[15033] | 357 | <delete dir="${script-build.dir}"/>
|
---|
[12582] | 358 | <delete dir="${checkstyle-build.dir}"/>
|
---|
[9765] | 359 | <delete dir="${dist.dir}"/>
|
---|
[4252] | 360 | <delete dir="${mapcss.dir}/parsergen"/>
|
---|
[8535] | 361 | <delete file="${src.dir}/org/w3/_2001/xmlschema/Adapter1.java"/>
|
---|
| 362 | <delete dir="${src.dir}/org/openstreetmap/josm/data/imagery/types"/>
|
---|
[9133] | 363 | <delete file="${epsg.output}"/>
|
---|
[13209] | 364 | <delete file="${pmd.dir}/cache"/>
|
---|
[4166] | 365 | </target>
|
---|
[7068] | 366 | <macrodef name="init-test-preferences">
|
---|
| 367 | <attribute name="testfamily"/>
|
---|
| 368 | <sequential>
|
---|
| 369 | <copy file="${test.dir}/config/preferences.template.xml" tofile="${test.dir}/config/@{testfamily}-josm.home/preferences.xml"/>
|
---|
| 370 | <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/>
|
---|
| 371 | <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/>
|
---|
| 372 | </sequential>
|
---|
| 373 | </macrodef>
|
---|
[17338] | 374 | <target name="test-init" depends="init" description="Initialize the tests">
|
---|
[6121] | 375 | <mkdir dir="${test.dir}/build"/>
|
---|
[7068] | 376 | <mkdir dir="${test.dir}/build/unit"/>
|
---|
| 377 | <mkdir dir="${test.dir}/build/functional"/>
|
---|
| 378 | <mkdir dir="${test.dir}/build/performance"/>
|
---|
[4166] | 379 | <mkdir dir="${test.dir}/report"/>
|
---|
[7068] | 380 | <init-test-preferences testfamily="unit"/>
|
---|
| 381 | <init-test-preferences testfamily="functional"/>
|
---|
| 382 | <init-test-preferences testfamily="performance"/>
|
---|
[16229] | 383 | <path id="test.classpath">
|
---|
| 384 | <path refid="test.path"/>
|
---|
| 385 | <pathelement path="${build.dir}"/>
|
---|
| 386 | <pathelement path="${resources.dir}"/>
|
---|
| 387 | </path>
|
---|
[16243] | 388 | <ivy:retrieve log="download-only" pattern="${test.dir}/lib/[artifact].[ext]" conf="jmockit"/>
|
---|
| 389 | <ivy:retrieve log="download-only" pattern="${tools.dir}/[artifact].[ext]" conf="commonslang"/>
|
---|
| 390 | <ivy:retrieve log="download-only" pattern="${tools.dir}/[conf].[ext]" conf="jacocoant"/>
|
---|
[13209] | 391 | <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="${tools.dir}/jacocoant.jar" />
|
---|
[4166] | 392 | </target>
|
---|
[17338] | 393 | <target name="test-clean" depends="init-properties" description="Delete all built test files">
|
---|
[6121] | 394 | <delete dir="${test.dir}/build"/>
|
---|
[4166] | 395 | <delete dir="${test.dir}/report"/>
|
---|
[6133] | 396 | <delete file="${test.dir}/jacoco.exec" />
|
---|
[9501] | 397 | <delete file="${test.dir}/jacocoIT.exec" />
|
---|
[10850] | 398 | <delete file="${test.dir}/config/unit-josm.home" failonerror="false"/>
|
---|
| 399 | <delete file="${test.dir}/config/functional-josm.home" failonerror="false"/>
|
---|
| 400 | <delete file="${test.dir}/config/performance-josm.home" failonerror="false"/>
|
---|
[4166] | 401 | </target>
|
---|
[14065] | 402 | <macrodef name="call-javac">
|
---|
[7068] | 403 | <attribute name="testfamily"/>
|
---|
| 404 | <element name="cp-elements"/>
|
---|
| 405 | <sequential>
|
---|
[14065] | 406 | <javac srcdir="${test.dir}/@{testfamily}" destdir="${test.dir}/build/@{testfamily}"
|
---|
| 407 | target="${java.lang.version}" source="${java.lang.version}" debug="on"
|
---|
[16346] | 408 | includeantruntime="false" encoding="UTF-8">
|
---|
[14065] | 409 | <compilerarg value="-Xlint:all"/>
|
---|
[16603] | 410 | <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] | 411 | <compilerarg value="-Xlint:-serial"/>
|
---|
[7068] | 412 | <classpath>
|
---|
| 413 | <cp-elements/>
|
---|
| 414 | </classpath>
|
---|
[14065] | 415 | </javac>
|
---|
[7068] | 416 | </sequential>
|
---|
| 417 | </macrodef>
|
---|
[17338] | 418 | <target name="test-compile" depends="test-init,compile,extract-libraries,epsg,copy-resources" description="Compile all tests">
|
---|
[14065] | 419 | <call-javac testfamily="unit">
|
---|
[7068] | 420 | <cp-elements>
|
---|
| 421 | <path refid="test.classpath"/>
|
---|
| 422 | </cp-elements>
|
---|
[14065] | 423 | </call-javac>
|
---|
| 424 | <call-javac testfamily="functional">
|
---|
[7068] | 425 | <cp-elements>
|
---|
| 426 | <path refid="test.classpath"/>
|
---|
| 427 | <pathelement path="${test.dir}/build/unit"/>
|
---|
| 428 | </cp-elements>
|
---|
[14065] | 429 | </call-javac>
|
---|
| 430 | <call-javac testfamily="performance">
|
---|
[7068] | 431 | <cp-elements>
|
---|
| 432 | <path refid="test.classpath"/>
|
---|
| 433 | <pathelement path="${test.dir}/build/unit"/>
|
---|
| 434 | </cp-elements>
|
---|
[14065] | 435 | </call-javac>
|
---|
[4166] | 436 | </target>
|
---|
[7068] | 437 | <macrodef name="call-junit">
|
---|
| 438 | <attribute name="testfamily"/>
|
---|
[9501] | 439 | <attribute name="testITsuffix" default=""/>
|
---|
[13523] | 440 | <attribute name="coverage" default="${coverageByDefault}"/>
|
---|
[15032] | 441 | <attribute name="includes" default="${default-junit@{testITsuffix}-includes}"/>
|
---|
| 442 | <attribute name="excludes" default="${default-junit@{testITsuffix}-excludes}"/>
|
---|
[7068] | 443 | <sequential>
|
---|
[9501] | 444 | <echo message="Running @{testfamily}@{testITsuffix} tests with JUnit"/>
|
---|
[16617] | 445 | <jacoco:agent destfile="${test.dir}/jacoco@{testITsuffix}.exec" enabled="@{coverage}" includes="${jacoco.includes}" dumponexit="true"
|
---|
| 446 | inclbootstrapclasses="${jacoco.inclbootstrapclasses}" inclnolocationclasses="${jacoco.inclnolocationclasses}" property="jacocoagent@{testfamily}@{testITsuffix}" if:true="@{coverage}"/>
|
---|
| 447 | <junitlauncher printsummary="${junit.printsummary}" failureproperty="test.@{testfamily}@{testITsuffix}.failed">
|
---|
| 448 | <classpath>
|
---|
| 449 | <path refid="test.classpath"/>
|
---|
| 450 | <pathelement path="${test.dir}/build/unit"/> <!-- required for functional/etc to have JOSMTestRules -->
|
---|
| 451 | <pathelement path="${test.dir}/build/@{testfamily}"/>
|
---|
| 452 | </classpath>
|
---|
| 453 | <testclasses outputDir="${test.dir}/report">
|
---|
| 454 | <fileset dir="${test.dir}/build/@{testfamily}" includes="@{includes}" excludes="@{excludes}"/>
|
---|
| 455 | <fork>
|
---|
| 456 | <jvmarg value="${jacocoagent@{testfamily}@{testITsuffix}}" if:set="jacocoagent@{testfamily}@{testITsuffix}" />
|
---|
| 457 | <jvmarg value="-Dfile.encoding=UTF-8"/>
|
---|
| 458 | <jvmarg value="-javaagent:${test.dir}/lib/jmockit.jar"/>
|
---|
[16659] | 459 | <jvmarg value="-Djunit.jupiter.extensions.autodetection.enabled=true"/>
|
---|
[17478] | 460 | <jvmarg value="-Djunit.jupiter.execution.parallel.enabled=true"/>
|
---|
[16617] | 461 | <jvmarg value="--add-modules" if:set="isJava9" unless:set="isJava11" />
|
---|
| 462 | <jvmarg value="java.activation,java.se.ee" if:set="isJava9" unless:set="isJava11" />
|
---|
| 463 | <jvmarg value="--add-exports" if:set="isJava9" unless:set="noJavaFX" />
|
---|
| 464 | <jvmarg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" if:set="isJava9" unless:set="noJavaFX" />
|
---|
| 465 | <jvmarg value="--add-exports" if:set="isJava9" unless:set="isJava11" />
|
---|
| 466 | <jvmarg value="jdk.deploy/com.sun.deploy.config=ALL-UNNAMED" if:set="isJava9" unless:set="isJava11" />
|
---|
| 467 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 468 | <jvmarg value="java.base/java.io=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 469 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 470 | <jvmarg value="java.base/java.lang=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 471 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 472 | <jvmarg value="java.base/java.nio=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 473 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 474 | <jvmarg value="java.base/java.text=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 475 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 476 | <jvmarg value="java.base/java.util=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 477 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 478 | <jvmarg value="java.base/jdk.internal.loader=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 479 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 480 | <jvmarg value="java.desktop/java.awt=ALL-UNNAMED" if:set="isJava9" />
|
---|
[17689] | 481 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
| 482 | <jvmarg value="java.prefs/java.util.prefs=ALL-UNNAMED" if:set="isJava9" />
|
---|
[16617] | 483 | <sysproperty key="josm.home" value="${test.dir}/config/@{testfamily}-josm.home"/>
|
---|
| 484 | <sysproperty key="josm.test.data" value="${test.dir}/data"/>
|
---|
| 485 | <sysproperty key="java.awt.headless" value="${test.headless}"/>
|
---|
| 486 | <sysproperty key="glass.platform" value="Monocle"/>
|
---|
| 487 | <sysproperty key="monocle.platform" value="Headless"/>
|
---|
| 488 | <sysproperty key="prism.order" value="sw"/>
|
---|
| 489 | <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
|
---|
[17403] | 490 | <sysproperty key="junit.jupiter.execution.parallel.enabled" value="${junit.jupiter.execution.parallel.enabled}" if:set="junit.jupiter.execution.parallel.enabled"/>
|
---|
| 491 | <sysproperty key="junit.jupiter.execution.parallel.mode.default" value="${junit.jupiter.execution.parallel.mode.default}" if:set="junit.jupiter.execution.parallel.mode.default"/>
|
---|
| 492 | <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] | 493 | </fork>
|
---|
| 494 | <listener type="legacy-plain" />
|
---|
| 495 | <listener type="legacy-xml" />
|
---|
| 496 | </testclasses>
|
---|
| 497 | </junitlauncher>
|
---|
[7068] | 498 | </sequential>
|
---|
| 499 | </macrodef>
|
---|
[9501] | 500 | <target name="test" depends="test-compile" unless="test.notRequired"
|
---|
[12534] | 501 | description="Run unit and functional tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
|
---|
[7068] | 502 | <call-junit testfamily="unit"/>
|
---|
| 503 | <call-junit testfamily="functional"/>
|
---|
[4166] | 504 | </target>
|
---|
[14141] | 505 | <target name="test-hardfail" depends="test" description="Run 'test' target but abort if tests failed">
|
---|
| 506 | <fail message="'test' failed">
|
---|
| 507 | <condition>
|
---|
| 508 | <or>
|
---|
| 509 | <isset property="test.unit.failed"/>
|
---|
| 510 | <isset property="test.functional.failed"/>
|
---|
| 511 | </or>
|
---|
| 512 | </condition>
|
---|
| 513 | </fail>
|
---|
| 514 | </target>
|
---|
| 515 | <target name="test-unit" depends="test-compile" unless="test-unit.notRequired"
|
---|
| 516 | description="Run unit tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
|
---|
| 517 | <call-junit testfamily="unit"/>
|
---|
| 518 | </target>
|
---|
| 519 | <target name="test-unit-hardfail" depends="test-unit" description="Run 'test-unit' target but abort if tests failed">
|
---|
| 520 | <fail message="'test-unit' failed" if="test.unit.failed"/>
|
---|
| 521 | </target>
|
---|
[16051] | 522 | <target name="test-it" depends="test-compile,create-revision" unless="test-it.notRequired"
|
---|
[9501] | 523 | description="Run integration tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
|
---|
| 524 | <call-junit testfamily="unit" testITsuffix="IT"/>
|
---|
| 525 | <call-junit testfamily="functional" testITsuffix="IT"/>
|
---|
| 526 | </target>
|
---|
[14141] | 527 | <target name="test-it-hardfail" depends="test-it" description="Run 'test-it' target but abort if tests failed">
|
---|
| 528 | <fail message="'test-it' failed">
|
---|
| 529 | <condition>
|
---|
| 530 | <or>
|
---|
| 531 | <isset property="test.unitIT.failed"/>
|
---|
| 532 | <isset property="test.functionalIT.failed"/>
|
---|
| 533 | </or>
|
---|
| 534 | </condition>
|
---|
| 535 | </fail>
|
---|
| 536 | </target>
|
---|
[12534] | 537 | <target name="test-perf" depends="test-compile" unless="test-perf.notRequired"
|
---|
| 538 | description="Run performance tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
|
---|
| 539 | <call-junit testfamily="performance" coverage="false"/>
|
---|
| 540 | </target>
|
---|
[14141] | 541 | <target name="test-perf-hardfail" depends="test-perf" description="Run 'test-perf' target but abort if tests failed">
|
---|
| 542 | <fail message="'test-perf' failed" if="test.performance.failed"/>
|
---|
| 543 | </target>
|
---|
[15703] | 544 | <target name="test-html" depends="test, test-it, test-perf" description="Generate HTML, CSV and XML test reports">
|
---|
[4166] | 545 | <!-- May require additional ant dependencies like ant-trax package -->
|
---|
| 546 | <junitreport todir="${test.dir}/report">
|
---|
| 547 | <fileset dir="${test.dir}/report">
|
---|
| 548 | <include name="TEST-*.xml"/>
|
---|
| 549 | </fileset>
|
---|
| 550 | <report todir="${test.dir}/report/html"/>
|
---|
| 551 | </junitreport>
|
---|
[6133] | 552 | <jacoco:report>
|
---|
| 553 | <executiondata>
|
---|
[11963] | 554 | <fileset dir="${test.dir}" includes="*.exec"/>
|
---|
[6133] | 555 | </executiondata>
|
---|
| 556 | <structure name="JOSM Test Coverage">
|
---|
| 557 | <classfiles>
|
---|
| 558 | <fileset dir="${build.dir}" includes="org/openstreetmap/"/>
|
---|
| 559 | </classfiles>
|
---|
| 560 | <sourcefiles encoding="UTF-8">
|
---|
| 561 | <fileset dir="${src.dir}" includes="org/openstreetmap/"/>
|
---|
| 562 | </sourcefiles>
|
---|
| 563 | </structure>
|
---|
[6134] | 564 | <html destdir="${test.dir}/report/jacoco"/>
|
---|
[15703] | 565 | <xml destfile="${test.dir}/report/jacoco.xml"/>
|
---|
| 566 | <csv destfile="${test.dir}/report/jacoco.csv"/>
|
---|
[6133] | 567 | </jacoco:report>
|
---|
[4166] | 568 | </target>
|
---|
[17338] | 569 | <target name="dist-optimized" depends="dist" unless="isJava13" description="Build an optimized JOSM distribution file">
|
---|
[16243] | 570 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="proguard.classpath" conf="proguard"/>
|
---|
[16169] | 571 | <taskdef resource="proguard/ant/task.properties" classpathref="proguard.classpath"/>
|
---|
[4166] | 572 | <proguard>
|
---|
[12628] | 573 | -injars ${dist.jar}
|
---|
| 574 | -outjars ${dist-optimized.jar}
|
---|
[4166] | 575 |
|
---|
[14244] | 576 | -libraryjars ${java.home}/${java.library.dir}
|
---|
[4166] | 577 |
|
---|
[7367] | 578 | -dontoptimize
|
---|
| 579 | -dontobfuscate
|
---|
[16116] | 580 | -dontwarn org.jetbrains.annotations.**
|
---|
[4166] | 581 |
|
---|
[7367] | 582 | # These options probably are not necessary (and make processing a bit slower)
|
---|
| 583 | -dontskipnonpubliclibraryclasses
|
---|
| 584 | -dontskipnonpubliclibraryclassmembers
|
---|
[4166] | 585 |
|
---|
[7367] | 586 | -keepclasseswithmembers public class org.openstreetmap.josm.gui.MainApplication {
|
---|
| 587 | public static void main(java.lang.String[]);
|
---|
| 588 | }
|
---|
[4166] | 589 |
|
---|
[7367] | 590 | -keep class * extends org.openstreetmap.josm.io.FileImporter
|
---|
| 591 | -keep class * extends org.openstreetmap.josm.io.FileExporter
|
---|
| 592 | -keep class org.openstreetmap.josm.actions.search.SearchCompiler$Never
|
---|
[10949] | 593 | -keep class org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory$PseudoClasses {
|
---|
[8532] | 594 | static boolean *(org.openstreetmap.josm.gui.mappaint.Environment);
|
---|
| 595 | }
|
---|
[4166] | 596 |
|
---|
[7367] | 597 | -keepclassmembers enum * {
|
---|
| 598 | public static **[] values();
|
---|
| 599 | public static ** valueOf(java.lang.String);
|
---|
| 600 | }
|
---|
[4166] | 601 |
|
---|
[12873] | 602 | # Keep unused public classes and methods (needed for plugins)
|
---|
| 603 | -keep public class * {
|
---|
[7367] | 604 | public protected *;
|
---|
| 605 | }
|
---|
[4838] | 606 |
|
---|
[12873] | 607 | # Keep serialization code
|
---|
[10949] | 608 | -keepclassmembers class * implements java.io.Serializable {
|
---|
[16617] | 609 | static final long serialVersionUID;
|
---|
[12873] | 610 | private static final java.io.ObjectStreamField[] serialPersistentFields;
|
---|
[10949] | 611 | private void writeObject(java.io.ObjectOutputStream);
|
---|
| 612 | private void readObject(java.io.ObjectInputStream);
|
---|
[16617] | 613 | java.lang.Object writeReplace();
|
---|
[12873] | 614 | java.lang.Object readResolve();
|
---|
[10949] | 615 | }
|
---|
| 616 |
|
---|
[7367] | 617 | # Disable annoying [proguard] Note: the configuration keeps the entry point '...', but not the descriptor class '...'.
|
---|
| 618 | # This note should not be a problem as we don't use obfuscation
|
---|
| 619 | -dontnote
|
---|
[6133] | 620 | </proguard>
|
---|
[4166] | 621 | </target>
|
---|
[14244] | 622 | <target name="dist-optimized-report" depends="dist-optimized">
|
---|
[10845] | 623 | <!-- generate difference report between optimized jar and normal one -->
|
---|
| 624 | <exec executable="perl" dir="${basedir}">
|
---|
[13209] | 625 | <arg value="${tools.dir}/japicc/japi-compliance-checker.pl"/>
|
---|
[10845] | 626 | <arg value="--lib=JOSM"/>
|
---|
| 627 | <arg value="--keep-internal"/>
|
---|
| 628 | <arg value="--v1=${version.entry.commit.revision}"/>
|
---|
| 629 | <arg value="--v2=${version.entry.commit.revision}-optimized"/>
|
---|
| 630 | <arg value="--report-path=${dist.dir}/compat_report.html"/>
|
---|
[12628] | 631 | <arg value="${dist.jar}"/>
|
---|
| 632 | <arg value="${dist-optimized.jar}"/>
|
---|
[10845] | 633 | </exec>
|
---|
| 634 | </target>
|
---|
[14258] | 635 | <target name="check-plugins" depends="dist-optimized" description="Check of plugins binary compatibility" unless="isJava11">
|
---|
[4166] | 636 | <local name="dir"/>
|
---|
| 637 | <local name="plugins"/>
|
---|
| 638 | <property name="dir" value="plugin-check"/>
|
---|
[17544] | 639 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="animal.classpath" conf="animal"/>
|
---|
[4166] | 640 | <typedef uri="antlib:org.codehaus.mojo.animal_sniffer">
|
---|
[17544] | 641 | <classpath refid="animal.classpath"/>
|
---|
[4166] | 642 | </typedef>
|
---|
[13574] | 643 | <delete dir="${dir}" failonerror="false"/>
|
---|
[4166] | 644 | <mkdir dir="${dir}"/>
|
---|
| 645 | <!-- List of deprecated plugins -->
|
---|
[7133] | 646 | <loadfile property="deprecated-plugins" srcFile="${src.dir}/org/openstreetmap/josm/plugins/PluginHandler.java">
|
---|
[4166] | 647 | <filterchain>
|
---|
| 648 | <linecontains>
|
---|
| 649 | <contains value="new DeprecatedPlugin("/>
|
---|
| 650 | </linecontains>
|
---|
| 651 | <tokenfilter>
|
---|
| 652 | <replaceregex pattern=".*new DeprecatedPlugin\("(.+?)".*" replace="\1|" flags="gi"/>
|
---|
| 653 | </tokenfilter>
|
---|
| 654 | <striplinebreaks/>
|
---|
| 655 | <tokenfilter>
|
---|
| 656 | <replaceregex pattern="\|$" replace="" flags="gi"/>
|
---|
| 657 | </tokenfilter>
|
---|
| 658 | </filterchain>
|
---|
| 659 | </loadfile>
|
---|
[5498] | 660 | <!-- Download list of plugins -->
|
---|
[4166] | 661 | <loadresource property="plugins">
|
---|
[6955] | 662 | <url url="https://josm.openstreetmap.de/plugin"/>
|
---|
[4166] | 663 | <filterchain>
|
---|
| 664 | <linecontainsregexp negate="true">
|
---|
| 665 | <regexp pattern="^\t.*"/>
|
---|
| 666 | </linecontainsregexp>
|
---|
| 667 | <linecontainsregexp negate="true">
|
---|
| 668 | <regexp pattern="${deprecated-plugins}"/>
|
---|
| 669 | </linecontainsregexp>
|
---|
[14244] | 670 | <linecontainsregexp negate="true" unless:set="isJava10">
|
---|
[14383] | 671 | <!-- Skip javafx on Java 8/9, built for Java 10+ only -->
|
---|
| 672 | <regexp pattern="javafx.*"/>
|
---|
[14244] | 673 | </linecontainsregexp>
|
---|
[15234] | 674 | <linecontainsregexp negate="true" unless:set="isJava11">
|
---|
| 675 | <!-- Skip http2 on Java 8/9/10, built for Java 11+ only -->
|
---|
| 676 | <regexp pattern="http2.*"/>
|
---|
| 677 | </linecontainsregexp>
|
---|
[4166] | 678 | <tokenfilter>
|
---|
| 679 | <replaceregex pattern="^.*;" replace="" flags="gi"/>
|
---|
| 680 | </tokenfilter>
|
---|
| 681 | </filterchain>
|
---|
[6133] | 682 | </loadresource>
|
---|
| 683 | <!-- Delete files that are not in plugin list (like old plugins) -->
|
---|
| 684 | <loadresource property="file-list">
|
---|
| 685 | <propertyresource name="plugins"/>
|
---|
| 686 | <filterchain>
|
---|
| 687 | <tokenfilter>
|
---|
| 688 | <replaceregex pattern="^.*/(.*)$" replace="\1\|" flags=""/>
|
---|
| 689 | </tokenfilter>
|
---|
| 690 | <striplinebreaks/>
|
---|
| 691 | <tokenfilter>
|
---|
| 692 | <replaceregex pattern="\|$" replace="" flags="gi"/>
|
---|
[9765] | 693 | </tokenfilter>
|
---|
[6133] | 694 | </filterchain>
|
---|
| 695 | </loadresource>
|
---|
| 696 | <delete>
|
---|
| 697 | <restrict>
|
---|
| 698 | <fileset dir="${dir}"/>
|
---|
| 699 | <not>
|
---|
| 700 | <name regex="${file-list}"/>
|
---|
| 701 | </not>
|
---|
| 702 | </restrict>
|
---|
| 703 | </delete>
|
---|
| 704 | <!-- Download plugins -->
|
---|
[12874] | 705 | <copy todir="${dir}" flatten="true" verbose="true" failonerror="false">
|
---|
[4166] | 706 | <resourcelist>
|
---|
| 707 | <string value="${plugins}"/>
|
---|
| 708 | </resourcelist>
|
---|
| 709 | </copy>
|
---|
| 710 | <!-- Check plugins -->
|
---|
[5498] | 711 | <as:build-signatures destfile="${dir}/api.sig">
|
---|
| 712 | <path>
|
---|
[12628] | 713 | <fileset file="${dist-optimized.jar}"/>
|
---|
[14244] | 714 | <fileset file="${java.home}/lib/rt.jar" unless:set="isJava9"/>
|
---|
| 715 | <fileset file="${java.home}/lib/jce.jar" unless:set="isJava9"/>
|
---|
| 716 | <fileset file="${java.home}/lib/ext/jfxrt.jar" unless:set="isJava9"/>
|
---|
| 717 | <fileset dir="${java.home}/jmods" if:set="isJava9"/>
|
---|
[14997] | 718 | <fileset dir="/usr/share/openjfx/lib" unless:set="isJava9"/>
|
---|
[5498] | 719 | </path>
|
---|
[6133] | 720 | </as:build-signatures>
|
---|
[12873] | 721 | <as:check-signature signature="${dir}/api.sig" failonerror="false">
|
---|
[13711] | 722 | <ignore classname="afu.*"/>
|
---|
[13921] | 723 | <ignore classname="android.*"/>
|
---|
[12873] | 724 | <ignore classname="au.*"/>
|
---|
[7367] | 725 | <ignore classname="com.*"/>
|
---|
[12873] | 726 | <ignore classname="de.*"/>
|
---|
| 727 | <ignore classname="edu.*"/>
|
---|
| 728 | <ignore classname="groovy.*"/>
|
---|
[13962] | 729 | <ignore classname="io.*"/>
|
---|
[12873] | 730 | <ignore classname="it.*"/>
|
---|
[14167] | 731 | <ignore classname="java.lang.invoke.MethodHandle"/>
|
---|
[15639] | 732 | <ignore classname="java.nio.ByteBuffer"/>
|
---|
| 733 | <ignore classname="java.nio.FloatBuffer"/>
|
---|
[15387] | 734 | <ignore classname="java.util.list.kotlin.*"/>
|
---|
[7367] | 735 | <ignore classname="javax.*"/>
|
---|
[14245] | 736 | <ignore classname="jdk.swing.interop.*"/>
|
---|
[7367] | 737 | <ignore classname="jogamp.*"/>
|
---|
| 738 | <ignore classname="junit.*"/>
|
---|
[12873] | 739 | <ignore classname="kdu_jni.*"/>
|
---|
[15387] | 740 | <ignore classname="kotlin.*"/>
|
---|
[12873] | 741 | <ignore classname="net.*"/>
|
---|
| 742 | <ignore classname="netscape.*"/>
|
---|
| 743 | <ignore classname="nu.*"/>
|
---|
| 744 | <ignore classname="oracle.*"/>
|
---|
[7367] | 745 | <ignore classname="org.apache.*"/>
|
---|
[12873] | 746 | <ignore classname="org.bouncycastle.*"/>
|
---|
[13711] | 747 | <ignore classname="org.checkerframework.*"/>
|
---|
[7367] | 748 | <ignore classname="org.codehaus.*"/>
|
---|
[13921] | 749 | <ignore classname="org.conscrypt.*"/>
|
---|
[7367] | 750 | <ignore classname="org.dom4j.*"/>
|
---|
[12873] | 751 | <ignore classname="org.eclipse.*"/>
|
---|
| 752 | <ignore classname="org.ejml.*"/>
|
---|
[14164] | 753 | <ignore classname="org.fusesource.*"/>
|
---|
[12873] | 754 | <ignore classname="org.gdal.*"/>
|
---|
[15377] | 755 | <ignore classname="org.geotools.data.h2.*"/>
|
---|
| 756 | <ignore classname="org.geotools.gce.imagemosaic.*"/>
|
---|
[12873] | 757 | <ignore classname="org.hibernate.*"/>
|
---|
[7367] | 758 | <ignore classname="org.hsqldb.*"/>
|
---|
| 759 | <ignore classname="org.ibex.*"/>
|
---|
[7934] | 760 | <ignore classname="org.iso_relax.*"/>
|
---|
[7367] | 761 | <ignore classname="org.jaitools.*"/>
|
---|
| 762 | <ignore classname="org.jaxen.*"/>
|
---|
[12873] | 763 | <ignore classname="org.jboss.*"/>
|
---|
[14164] | 764 | <ignore classname="org.jctools.*"/>
|
---|
[13575] | 765 | <ignore classname="org.jdom.*"/>
|
---|
[7367] | 766 | <ignore classname="org.jdom2.*"/>
|
---|
[12873] | 767 | <ignore classname="org.jfree.*"/>
|
---|
[4166] | 768 | <ignore classname="org.jgraph.*"/>
|
---|
[12873] | 769 | <ignore classname="org.joda.*"/>
|
---|
[14164] | 770 | <ignore classname="org.json.*"/>
|
---|
[12873] | 771 | <ignore classname="org.junit.*"/>
|
---|
| 772 | <ignore classname="org.jvnet.*"/>
|
---|
[7367] | 773 | <ignore classname="org.kxml2.*"/>
|
---|
[15639] | 774 | <ignore classname="org.locationtech.*"/>
|
---|
[15462] | 775 | <ignore classname="org.mozilla.*"/>
|
---|
[8090] | 776 | <ignore classname="org.objectweb.*"/>
|
---|
[15387] | 777 | <ignore classname="org.opentest4j.*"/>
|
---|
[12873] | 778 | <ignore classname="org.osgi.*"/>
|
---|
| 779 | <ignore classname="org.postgresql.*"/>
|
---|
[7367] | 780 | <ignore classname="org.python.*"/>
|
---|
[12875] | 781 | <ignore classname="org.seasar.*"/>
|
---|
[7367] | 782 | <ignore classname="org.slf4j.*"/>
|
---|
[12873] | 783 | <ignore classname="org.springframework.*"/>
|
---|
| 784 | <ignore classname="org.testng.*"/>
|
---|
[13113] | 785 | <ignore classname="org.w3c.*"/>
|
---|
[12873] | 786 | <ignore classname="org.zeromq.*"/>
|
---|
[15540] | 787 | <ignore classname="waffle.*"/>
|
---|
[8173] | 788 | <!-- plugins used by another ones -->
|
---|
[7494] | 789 | <ignore classname="org.openstreetmap.josm.plugins.geotools.*"/>
|
---|
[14244] | 790 | <ignore classname="org.openstreetmap.josm.plugins.jaxb.*"/>
|
---|
[7934] | 791 | <ignore classname="org.openstreetmap.josm.plugins.jna.*"/>
|
---|
[7494] | 792 | <ignore classname="org.openstreetmap.josm.plugins.jts.*"/>
|
---|
| 793 | <ignore classname="org.openstreetmap.josm.plugins.log4j.*"/>
|
---|
[14244] | 794 | <ignore classname="org.openstreetmap.josm.plugins.openjfx.*"/>
|
---|
[7494] | 795 | <ignore classname="org.openstreetmap.josm.plugins.utilsplugin2.*"/>
|
---|
[12875] | 796 | <ignore classname="sun.*"/>
|
---|
[4166] | 797 | <path path="${dir}"/>
|
---|
| 798 | </as:check-signature>
|
---|
| 799 | </target>
|
---|
[4838] | 800 |
|
---|
[17338] | 801 | <target name="script-compile" depends="test-compile" description="Compile all scripts">
|
---|
[15033] | 802 | <javac sourcepath="" srcdir="${base.dir}/scripts" failonerror="true" includes="*.java"
|
---|
| 803 | destdir="${script-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on"
|
---|
[16346] | 804 | includeantruntime="false" encoding="UTF-8">
|
---|
[15033] | 805 | <classpath>
|
---|
| 806 | <pathelement path="${build.dir}"/>
|
---|
| 807 | <pathelement path="${test.dir}/build/unit"/>
|
---|
| 808 | <pathelement path="${commons-lang3.jar}"/>
|
---|
| 809 | </classpath>
|
---|
[14636] | 810 | </javac>
|
---|
| 811 | </target>
|
---|
| 812 |
|
---|
[8687] | 813 | <macrodef name="_taginfo">
|
---|
| 814 | <attribute name="type"/>
|
---|
| 815 | <attribute name="output"/>
|
---|
| 816 | <sequential>
|
---|
| 817 | <echo message="Generating Taginfo for type @{type} to @{output}"/>
|
---|
[14636] | 818 | <java classname="TagInfoExtract" failonerror="true" fork="false">
|
---|
| 819 | <sysproperty key="java.awt.headless" value="true"/>
|
---|
| 820 | <classpath>
|
---|
[16126] | 821 | <pathelement path="${build.dir}"/>
|
---|
[15033] | 822 | <pathelement path="${script-build.dir}"/>
|
---|
| 823 | <pathelement path="${commons-lang3.jar}"/>
|
---|
[14636] | 824 | </classpath>
|
---|
| 825 | <arg value="--type"/>
|
---|
[8687] | 826 | <arg value="@{type}"/>
|
---|
| 827 | <arg value="--noexit"/>
|
---|
| 828 | <arg value="--imgurlprefix"/>
|
---|
[14636] | 829 | <arg value="http://josm.openstreetmap.de/download/taginfo/taginfo-img"/>
|
---|
| 830 | <arg value="--output"/>
|
---|
[8687] | 831 | <arg value="@{output}"/>
|
---|
[14636] | 832 | </java>
|
---|
[8687] | 833 | </sequential>
|
---|
| 834 | </macrodef>
|
---|
| 835 |
|
---|
[17338] | 836 | <target name="taginfo" depends="script-compile" description="Generate project files Taginfo">
|
---|
[9250] | 837 | <_taginfo type="mappaint" output="taginfo_style.json"/>
|
---|
| 838 | <_taginfo type="presets" output="taginfo_presets.json"/>
|
---|
| 839 | <_taginfo type="external_presets" output="taginfo_external_presets.json"/>
|
---|
[8687] | 840 | </target>
|
---|
| 841 |
|
---|
[17338] | 842 | <target name="imageryindex" depends="script-compile" description="Check editor imagery difference">
|
---|
[9505] | 843 | <echo message="Checking editor imagery difference"/>
|
---|
[15033] | 844 | <java classname="SyncEditorLayerIndex" failonerror="true" fork="false">
|
---|
| 845 | <classpath>
|
---|
[16126] | 846 | <pathelement path="${build.dir}"/>
|
---|
[15033] | 847 | <pathelement path="${script-build.dir}"/>
|
---|
| 848 | <pathelement path="${commons-lang3.jar}"/>
|
---|
| 849 | </classpath>
|
---|
| 850 | <arg value="--noeli"/>
|
---|
| 851 | <arg value="-p"/>
|
---|
| 852 | <arg value="imagery_eliout.imagery.xml"/>
|
---|
| 853 | <arg value="-q"/>
|
---|
| 854 | <arg value="imagery_josmout.imagery.xml"/>
|
---|
| 855 | </java>
|
---|
[9505] | 856 | </target>
|
---|
| 857 |
|
---|
[17338] | 858 | <target name="imageryindexdownload" description="Download and check editor imagery">
|
---|
[9505] | 859 | <exec append="false" executable="wget" failifexecutionfails="true">
|
---|
| 860 | <arg value="https://josm.openstreetmap.de/maps"/>
|
---|
| 861 | <arg value="-O"/>
|
---|
[11965] | 862 | <arg value="imagery_josm.imagery.xml"/>
|
---|
[9505] | 863 | <arg value="--unlink"/>
|
---|
| 864 | </exec>
|
---|
| 865 | <exec append="false" executable="wget" failifexecutionfails="true">
|
---|
[11238] | 866 | <arg value="https://josm.openstreetmap.de/wiki/ImageryCompareIgnores?format=txt"/>
|
---|
| 867 | <arg value="-O"/>
|
---|
[11965] | 868 | <arg value="imagery_josm.ignores.txt"/>
|
---|
[11238] | 869 | <arg value="--unlink"/>
|
---|
| 870 | </exec>
|
---|
| 871 | <exec append="false" executable="wget" failifexecutionfails="true">
|
---|
[16375] | 872 | <arg value="https://raw.githubusercontent.com/osmlab/editor-layer-index/gh-pages/imagery.geojson"/>
|
---|
[9505] | 873 | <arg value="-O"/>
|
---|
[11965] | 874 | <arg value="imagery_eli.geojson"/>
|
---|
[9505] | 875 | <arg value="--unlink"/>
|
---|
| 876 | </exec>
|
---|
| 877 | <antcall target="imageryindex"/>
|
---|
| 878 | </target>
|
---|
| 879 |
|
---|
[17338] | 880 | <target name="checkstyle-compile" depends="init" description="Compile Checkstyle rules">
|
---|
[16243] | 881 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="checkstyle.classpath" conf="checkstyle"/>
|
---|
[12582] | 882 | <mkdir dir="${checkstyle-build.dir}"/>
|
---|
[13209] | 883 | <javac sourcepath="" srcdir="${checkstyle.dir}/src" failonerror="true"
|
---|
[12628] | 884 | destdir="${checkstyle-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on"
|
---|
[16346] | 885 | includeantruntime="false"
|
---|
[16171] | 886 | encoding="UTF-8" classpathref="checkstyle.classpath">
|
---|
[12582] | 887 | </javac>
|
---|
| 888 | </target>
|
---|
[17338] | 889 | <target name="checkstyle-changed" depends="checkstyle-compile" description="Run Checkstyle on SVN/Git-changed source files">
|
---|
[13303] | 890 | <exec append="false" osfamily="unix" executable="bash" failifexecutionfails="true">
|
---|
| 891 | <arg value="-c"/>
|
---|
[16171] | 892 | <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] | 893 | </exec>
|
---|
| 894 | <exec append="false" osfamily="windows" executable="powershell" failifexecutionfails="true">
|
---|
| 895 | <arg value="/c"/>
|
---|
[16171] | 896 | <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] | 897 | </exec>
|
---|
| 898 | </target>
|
---|
[17338] | 899 | <target name="checkstyle" depends="checkstyle-compile" description="Run Checkstyle on the source files">
|
---|
[16171] | 900 | <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties">
|
---|
| 901 | <classpath refid="checkstyle.classpath"/>
|
---|
| 902 | <classpath path="${checkstyle-build.dir}"/>
|
---|
| 903 | </taskdef>
|
---|
[13209] | 904 | <checkstyle config="${checkstyle.dir}/josm_checks.xml">
|
---|
[9765] | 905 | <fileset dir="${base.dir}/src/org/openstreetmap/josm" includes="**/*.java"
|
---|
[9250] | 906 | excludes="gui/mappaint/mapcss/parsergen/*.java"/>
|
---|
[9765] | 907 | <fileset dir="${base.dir}/test" includes="**/*.java"/>
|
---|
[14637] | 908 | <fileset dir="${base.dir}/scripts" includes="**/*.java"/>
|
---|
[11681] | 909 | <formatter type="plain"/>
|
---|
[8508] | 910 | <formatter type="xml" toFile="checkstyle-josm.xml"/>
|
---|
| 911 | </checkstyle>
|
---|
| 912 | </target>
|
---|
| 913 |
|
---|
[17338] | 914 | <target name="spotbugs" depends="dist" description="Run SpotBugs on the source files">
|
---|
[16243] | 915 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="spotbugs.classpath" conf="spotbugs"/>
|
---|
[16169] | 916 | <taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="spotbugs.classpath"/>
|
---|
[12801] | 917 | <spotbugs output="xml"
|
---|
| 918 | outputFile="spotbugs-josm.xml"
|
---|
[16166] | 919 | classpath="${toString:spotbugs.classpath}"
|
---|
[6133] | 920 | pluginList=""
|
---|
[13209] | 921 | excludeFilter="${spotbugs.dir}/josm-filter.xml"
|
---|
[16229] | 922 | onlyAnalyze="org.openstreetmap.josm.-"
|
---|
[6133] | 923 | effort="max"
|
---|
[10223] | 924 | reportLevel="low"
|
---|
[6133] | 925 | >
|
---|
[16229] | 926 | <class location="${dist.jar}" />
|
---|
[12801] | 927 | </spotbugs>
|
---|
[4838] | 928 | </target>
|
---|
[11713] | 929 |
|
---|
[17338] | 930 | <target name="pmd" depends="init" description="Run PMD on the source files">
|
---|
[16243] | 931 | <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="pmd.classpath" conf="pmd"/>
|
---|
[16169] | 932 | <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath"/>
|
---|
[13209] | 933 | <pmd shortFilenames="true" cacheLocation="${pmd.dir}/cache" encoding="UTF-8">
|
---|
[12628] | 934 | <sourceLanguage name="java" version="${java.lang.version}" />
|
---|
[13209] | 935 | <ruleset>${pmd.dir}/josm-ruleset.xml</ruleset>
|
---|
[11713] | 936 | <formatter type="text" toConsole="true" />
|
---|
| 937 | <formatter type="xml" toFile="pmd-josm.xml">
|
---|
| 938 | <param name="encoding" value="UTF-8" />
|
---|
| 939 | </formatter>
|
---|
| 940 | <fileset dir="${src.dir}">
|
---|
| 941 | <include name="org/openstreetmap/josm/**/*.java"/>
|
---|
| 942 | <exclude name="org/openstreetmap/josm/gui/mappaint/mapcss/parsergen/*.java" />
|
---|
| 943 | </fileset>
|
---|
[14638] | 944 | <fileset dir="${base.dir}/scripts" includes="**/*.java"/>
|
---|
[11713] | 945 | </pmd>
|
---|
| 946 | </target>
|
---|
| 947 |
|
---|
[17338] | 948 | <target name="run" depends="dist" description="Run JOSM">
|
---|
[12628] | 949 | <java jar="${dist.jar}" fork="true">
|
---|
[5323] | 950 | <arg value="--set=expert=true"/>
|
---|
[15797] | 951 | <arg value="--set=iso.dates=true"/>
|
---|
[5323] | 952 | <jvmarg value="-Djosm.home=/tmp/.josm/"/>
|
---|
| 953 | </java>
|
---|
| 954 | </target>
|
---|
[17338] | 955 | <target name="epsg-compile" depends="init"
|
---|
| 956 | description="Compile build script for generating projection list">
|
---|
[9765] | 957 | <property name="proj-classpath" location="${build.dir}"/>
|
---|
| 958 | <mkdir dir="${proj-build.dir}"/>
|
---|
[13794] | 959 | <javac sourcepath="" srcdir="${base.dir}/scripts" failonerror="true" includes="BuildProjectionDefinitions.java"
|
---|
[12628] | 960 | destdir="${proj-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on"
|
---|
[16346] | 961 | includeantruntime="false"
|
---|
[9765] | 962 | encoding="UTF-8" classpath="${proj-classpath}">
|
---|
[9133] | 963 | </javac>
|
---|
| 964 | </target>
|
---|
[17338] | 965 | <target name="epsg" unless="epsg.notRequired" depends="epsg-compile"
|
---|
| 966 | description="Generate projection list">
|
---|
[13236] | 967 | <touch file="${epsg.output}" mkdirs="true"/>
|
---|
[10259] | 968 | <java classname="BuildProjectionDefinitions" failonerror="true" fork="true">
|
---|
[9735] | 969 | <sysproperty key="java.awt.headless" value="true"/>
|
---|
[9133] | 970 | <classpath>
|
---|
[16140] | 971 | <pathelement path="${resources.dir}"/>
|
---|
[9765] | 972 | <pathelement path="${proj-classpath}"/>
|
---|
| 973 | <pathelement path="${proj-build.dir}"/>
|
---|
[9133] | 974 | </classpath>
|
---|
[9765] | 975 | <arg value="${base.dir}"/>
|
---|
[9133] | 976 | </java>
|
---|
| 977 | </target>
|
---|
[17338] | 978 | <target name="update-proj-files" depends="test-compile"
|
---|
| 979 | description="Update projection test files after an update of projection definitions">
|
---|
[14568] | 980 | <java classname="org.openstreetmap.josm.data.projection.ProjectionRefTest" failonerror="true" fork="true">
|
---|
| 981 | <classpath>
|
---|
| 982 | <path refid="test.classpath"/>
|
---|
| 983 | <pathelement path="${test.dir}/build/unit"/>
|
---|
| 984 | </classpath>
|
---|
| 985 | </java>
|
---|
| 986 | <java classname="org.openstreetmap.josm.data.projection.ProjectionRegressionTest" failonerror="true" fork="true">
|
---|
| 987 | <classpath>
|
---|
| 988 | <path refid="test.classpath"/>
|
---|
| 989 | <pathelement path="${test.dir}/build/unit"/>
|
---|
| 990 | </classpath>
|
---|
| 991 | </java>
|
---|
| 992 | </target>
|
---|
[17338] | 993 | <target name="jdeps" depends="compile" description="Generate jdeps dependency graph">
|
---|
[14136] | 994 | <delete dir="${modules.dir}"/>
|
---|
| 995 | <mkdir dir="${modules.dir}"/>
|
---|
| 996 | <!-- JOSM only -->
|
---|
| 997 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-actions.jar" includes="org/openstreetmap/josm/actions/**/*.class"/>
|
---|
| 998 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-cli.jar" includes="org/openstreetmap/josm/cli/**/*.class"/>
|
---|
| 999 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-command.jar" includes="org/openstreetmap/josm/command/**/*.class"/>
|
---|
| 1000 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-data.jar" includes="org/openstreetmap/josm/data/**/*.class"/>
|
---|
| 1001 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-gui.jar" includes="org/openstreetmap/josm/gui/**/*.class"/>
|
---|
| 1002 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-io.jar" includes="org/openstreetmap/josm/io/**/*.class"/>
|
---|
| 1003 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-plugins.jar" includes="org/openstreetmap/josm/plugins/**/*.class"/>
|
---|
| 1004 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-spi.jar" includes="org/openstreetmap/josm/spi/**/*.class"/>
|
---|
| 1005 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-tools.jar" includes="org/openstreetmap/josm/tools/**/*.class"/>
|
---|
| 1006 | <exec executable="jdeps" dir="${modules.dir}">
|
---|
[16050] | 1007 | <arg line="-f 'java.*|org.xml.*|org.w3c.*|sun.*|com.*|oauth.*|org.apache.*|org.glassfish.*|org.openstreetmap.gui.*'"/>
|
---|
[14136] | 1008 | <arg line="-dotoutput dots *.jar"/>
|
---|
| 1009 | </exec>
|
---|
| 1010 | <exec executable="dot" dir="${modules.dir}/dots">
|
---|
| 1011 | <arg line="-O -Tpng summary.dot"/>
|
---|
| 1012 | </exec>
|
---|
| 1013 | <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-without-dependencies.png"/>
|
---|
| 1014 | <!-- Direct dependencies -->
|
---|
[16050] | 1015 | <copy todir="${modules.dir}" flatten="true">
|
---|
| 1016 | <fileset refid="runtime.fileset" />
|
---|
| 1017 | </copy>
|
---|
[14136] | 1018 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/svgSalamander.jar" includes="com/kitfox/**/*.class"/>
|
---|
| 1019 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/oauth-signpost.jar" includes="oauth/**/*.class"/>
|
---|
[16399] | 1020 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/commons-jcs.jar" includes="org/apache/commons/jcs3/**/*.class"/>
|
---|
[14136] | 1021 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/jmapviewer.jar" includes="org/openstreetmap/gui/**/*.class"/>
|
---|
| 1022 | <exec executable="jdeps" dir="${modules.dir}">
|
---|
[16408] | 1023 | <arg line="-f 'java.*|org.xml.*|org.w3c.*|sun.*|com.sun.*|com.google.*|org.tukaani.*'"/>
|
---|
[14136] | 1024 | <arg line="-dotoutput dots *.jar"/>
|
---|
| 1025 | </exec>
|
---|
| 1026 | <exec executable="dot" dir="${modules.dir}/dots">
|
---|
| 1027 | <arg line="-O -Tpng summary.dot"/>
|
---|
| 1028 | </exec>
|
---|
| 1029 | <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-with-direct-dependencies.png"/>
|
---|
| 1030 | <!-- All dependencies -->
|
---|
| 1031 | <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/google-gdata.jar" includes="com/google/**/*.class"/>
|
---|
| 1032 | <exec executable="jdeps" dir="${modules.dir}">
|
---|
| 1033 | <arg line="-dotoutput dots *.jar"/>
|
---|
| 1034 | </exec>
|
---|
| 1035 | <exec executable="dot" dir="${modules.dir}/dots">
|
---|
| 1036 | <arg line="-O -Tpng summary.dot"/>
|
---|
| 1037 | </exec>
|
---|
| 1038 | <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-with-all-dependencies.png"/>
|
---|
| 1039 | </target>
|
---|
[16050] | 1040 | <target name="resolve" depends="init-ivy" unless="resolve.notRequired" description="Resolve Ivy dependencies">
|
---|
[16125] | 1041 | <ivy:settings file="${base.dir}/ivysettings.xml"/>
|
---|
[16243] | 1042 | <ivy:resolve log="download-only" file="${base.dir}/ivy.xml" keep="true"/>
|
---|
| 1043 | <ivy:cachepath log="download-only" pathid="compile.path" conf="compile"/>
|
---|
| 1044 | <ivy:cachepath log="download-only" pathid="runtime.path" conf="runtime"/>
|
---|
| 1045 | <ivy:cachefileset log="download-only" setid="runtime.fileset" conf="runtime"/>
|
---|
| 1046 | <ivy:cachepath log="download-only" pathid="test.path" conf="test"/>
|
---|
[15977] | 1047 | </target>
|
---|
[17338] | 1048 | <target name="extract-libraries" depends="resolve" description="Extract libraries to build dir">
|
---|
[16002] | 1049 | <unzip dest="${build.dir}">
|
---|
| 1050 | <fileset refid="runtime.fileset"/>
|
---|
| 1051 | <patternset>
|
---|
[16397] | 1052 | <exclude name="META-INF/*"/>
|
---|
| 1053 | <exclude name="META-INF/maven/**"/>
|
---|
[17644] | 1054 | <exclude name="META-INF/resources/webjars/tag2link/*/LICENSE"/>
|
---|
| 1055 | <exclude name="META-INF/resources/webjars/tag2link/*/README.md"/>
|
---|
| 1056 | <exclude name="META-INF/resources/webjars/tag2link/*/build.js"/>
|
---|
| 1057 | <exclude name="META-INF/resources/webjars/tag2link/*/package.json"/>
|
---|
| 1058 | <exclude name="META-INF/resources/webjars/tag2link/*/schema.json"/>
|
---|
| 1059 | <exclude name="META-INF/resources/webjars/tag2link/*/tag2link.sophox.sparql"/>
|
---|
| 1060 | <exclude name="META-INF/resources/webjars/tag2link/*/tag2link.wikidata.sparql"/>
|
---|
[16397] | 1061 | <exclude name="META-INF/versions/**"/>
|
---|
[16002] | 1062 | <exclude name="*"/>
|
---|
[16194] | 1063 | <exclude name="org/openstreetmap/gui/jmapviewer/Demo*"/>
|
---|
[16027] | 1064 | <exclude name="com/drew/imaging/FileTypeDetector*"/>
|
---|
| 1065 | <exclude name="com/drew/imaging/ImageMetadataReader*"/>
|
---|
[16025] | 1066 | <exclude name="com/drew/imaging/avi/**"/>
|
---|
| 1067 | <exclude name="com/drew/imaging/bmp/**"/>
|
---|
| 1068 | <exclude name="com/drew/imaging/eps/**"/>
|
---|
| 1069 | <exclude name="com/drew/imaging/gif/**"/>
|
---|
| 1070 | <exclude name="com/drew/imaging/heif/**"/>
|
---|
| 1071 | <exclude name="com/drew/imaging/ico/**"/>
|
---|
| 1072 | <exclude name="com/drew/imaging/mp3/**"/>
|
---|
| 1073 | <exclude name="com/drew/imaging/mp4/**"/>
|
---|
| 1074 | <exclude name="com/drew/imaging/pcx/**"/>
|
---|
| 1075 | <exclude name="com/drew/imaging/psd/**"/>
|
---|
| 1076 | <exclude name="com/drew/imaging/quicktime/**"/>
|
---|
| 1077 | <exclude name="com/drew/imaging/raf/**"/>
|
---|
| 1078 | <exclude name="com/drew/imaging/riff/**"/>
|
---|
| 1079 | <exclude name="com/drew/imaging/wav/**"/>
|
---|
| 1080 | <exclude name="com/drew/imaging/webp/**"/>
|
---|
| 1081 | <exclude name="com/drew/metadata/avi/**"/>
|
---|
| 1082 | <exclude name="com/drew/metadata/bmp/**"/>
|
---|
| 1083 | <exclude name="com/drew/metadata/eps/**"/>
|
---|
| 1084 | <exclude name="com/drew/metadata/gif/**"/>
|
---|
| 1085 | <exclude name="com/drew/metadata/heif/**"/>
|
---|
| 1086 | <exclude name="com/drew/metadata/ico/**"/>
|
---|
| 1087 | <exclude name="com/drew/metadata/mov/**"/>
|
---|
| 1088 | <exclude name="com/drew/metadata/mp3/**"/>
|
---|
| 1089 | <exclude name="com/drew/metadata/mp4/**"/>
|
---|
| 1090 | <exclude name="com/drew/metadata/pcx/**"/>
|
---|
| 1091 | <exclude name="com/drew/metadata/wav/**"/>
|
---|
| 1092 | <exclude name="com/drew/metadata/webp/**"/>
|
---|
| 1093 | <exclude name="com/drew/tools/**"/>
|
---|
[16026] | 1094 | <exclude name="org/apache/commons/compress/PasswordRequiredException*"/>
|
---|
[16023] | 1095 | <exclude name="org/apache/commons/compress/archivers/**"/>
|
---|
| 1096 | <exclude name="org/apache/commons/compress/changes/**"/>
|
---|
[16026] | 1097 | <exclude name="org/apache/commons/compress/compressors/bzip2/BZip2Utils*"/>
|
---|
[16023] | 1098 | <exclude name="org/apache/commons/compress/compressors/brotli/**"/>
|
---|
[16026] | 1099 | <exclude name="org/apache/commons/compress/compressors/CompressorStreamFactory*"/>
|
---|
| 1100 | <exclude name="org/apache/commons/compress/compressors/CompressorStreamProvider*"/>
|
---|
| 1101 | <exclude name="org/apache/commons/compress/compressors/CompressorException*"/>
|
---|
| 1102 | <exclude name="org/apache/commons/compress/compressors/FileNameUtil*"/>
|
---|
[16023] | 1103 | <exclude name="org/apache/commons/compress/compressors/deflate/**"/>
|
---|
| 1104 | <exclude name="org/apache/commons/compress/compressors/gzip/**"/>
|
---|
| 1105 | <exclude name="org/apache/commons/compress/compressors/lz4/**"/>
|
---|
| 1106 | <exclude name="org/apache/commons/compress/compressors/lzma/**"/>
|
---|
| 1107 | <exclude name="org/apache/commons/compress/compressors/lz77support/**"/>
|
---|
| 1108 | <exclude name="org/apache/commons/compress/compressors/pack200/**"/>
|
---|
| 1109 | <exclude name="org/apache/commons/compress/compressors/snappy/**"/>
|
---|
[16026] | 1110 | <exclude name="org/apache/commons/compress/compressors/xz/XZUtils*"/>
|
---|
[16023] | 1111 | <exclude name="org/apache/commons/compress/compressors/z/**"/>
|
---|
| 1112 | <exclude name="org/apache/commons/compress/compressors/zstandard/**"/>
|
---|
| 1113 | <exclude name="org/apache/commons/compress/parallel/**"/>
|
---|
[16026] | 1114 | <exclude name="org/apache/commons/compress/utils/ArchiveUtils*"/>
|
---|
[16399] | 1115 | <exclude name="org/apache/commons/jcs3/auxiliary/disk/jdbc/**"/>
|
---|
| 1116 | <exclude name="org/apache/commons/jcs3/auxiliary/remote/http/client/**"/>
|
---|
| 1117 | <exclude name="org/apache/commons/jcs3/auxiliary/remote/http/server/RemoteHttpCacheServlet*"/>
|
---|
| 1118 | <exclude name="org/apache/commons/jcs3/auxiliary/remote/server/RemoteCacheStartupServlet*"/>
|
---|
| 1119 | <exclude name="org/apache/commons/jcs3/log/Log4j2Factory*"/>
|
---|
| 1120 | <exclude name="org/apache/commons/jcs3/log/Log4j2LogAdapter*"/>
|
---|
| 1121 | <exclude name="org/apache/commons/jcs3/utils/servlet/**"/>
|
---|
[16002] | 1122 | </patternset>
|
---|
| 1123 | </unzip>
|
---|
| 1124 | </target>
|
---|
[17338] | 1125 | <target name="sources" description="Generate jar file of JOSM source files and its dependencies" depends="init,epsg,resolve">
|
---|
[16243] | 1126 | <ivy:cachefileset log="download-only" setid="sources.fileset" conf="sources"/>
|
---|
[16141] | 1127 | <jar destfile="${dist-sources.jar}" level="${clevel}">
|
---|
| 1128 | <zipgroupfileset refid="sources.fileset"/>
|
---|
[16350] | 1129 | <fileset dir="${src.dir}"/>
|
---|
[16141] | 1130 | <fileset dir="${resources.dir}"/>
|
---|
| 1131 | </jar>
|
---|
| 1132 | </target>
|
---|
[15977] | 1133 | <target name="bootstrap-workspace" description="Copy libraries from ivy cache to workspace folders for IDE" depends="resolve">
|
---|
| 1134 | <delete dir="${lib.dir}"/>
|
---|
[16229] | 1135 | <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[type].[ext]" conf="compile,runtime,sources,test"/>
|
---|
[16556] | 1136 | <ivy:retrieve pattern="${lib.dir}/tools/[artifact]-[type].[ext]" conf="javacc,checkstyle,pmd,spotbugs,errorprone" file="${tools.ivy}"/>
|
---|
[15977] | 1137 | </target>
|
---|
[17338] | 1138 | <target name="ivy-report" description="Generate Ivy reports of dependency resolving" depends="resolve">
|
---|
[16243] | 1139 | <ivy:report todir="${tools.dir}/ivy-report" graph="false"/>
|
---|
| 1140 | </target>
|
---|
[16898] | 1141 | <target name="ivy-checkdepsupdate" description="Display dependency updates on the console" depends="resolve">
|
---|
| 1142 | <ivy:checkdepsupdate/>
|
---|
| 1143 | </target>
|
---|
[16229] | 1144 | <target name="api-dependency-tree" description="Displays Ivy dependency tree for JOSM API" depends="resolve">
|
---|
| 1145 | <ivy:dependencytree conf="api"/>
|
---|
| 1146 | </target>
|
---|
| 1147 | <target name="test-dependency-tree" description="Displays Ivy dependency tree for JOSM tests" depends="resolve">
|
---|
| 1148 | <ivy:dependencytree conf="test"/>
|
---|
| 1149 | </target>
|
---|
[4166] | 1150 | </project>
|
---|