source: josm/trunk/build.xml@ 15970

Last change on this file since 15970 was 15963, checked in by Don-vip, 5 years ago

see #17516 - update to error-prone 2.3.5-SNAPSHOT plus following patches for Java 13 compatibility (https://github.com/don-vip/error-prone/commits/jdk13):

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