source: josm/trunk/build.xml@ 14338

Last change on this file since 14338 was 14318, checked in by Don-vip, 6 years ago

see #16047 - update to JMockit 1.43 (contains Java11 fix)

see https://github.com/jmockit/jmockit1/issues/534

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