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