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