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