source: josm/trunk/build.xml@ 14233

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

add missing --add-opens java.base/jdk.internal.loader for plugin integration test

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