Debian Codegraph @

build.xml

raw symbols ◀ ▶ SCIP
2 Debian patches touch this file
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
7 ** This will create 'josm-custom.jar' in directory 'dist'. See also
8 ** https://josm.openstreetmap.de/wiki/DevelopersGuide/CreateBuild
9 **
10 -->
11 <project name="josm" default="dist"
12 xmlns:as="antlib:org.codehaus.mojo.animal_sniffer"
13 xmlns:if="ant:if"
14 xmlns:ivy="antlib:org.apache.ivy.ant"
15 xmlns:jacoco="antlib:org.jacoco.ant"
16 xmlns:unless="ant:unless"
17 >
18 <target name="init-javaversions" description="Initialize Java version properties">
19 <!-- For Java specific stuff by version -->
20 <!-- <condition property="isJava12"><matches string="${ant.java.version}" pattern="1[2-9]|[2-9][0-9]" /></condition> -->
21 <condition property="isJava13"><matches string="${ant.java.version}" pattern="1[3-9]|[2-9][0-9]" /></condition>
22 <!-- <condition property="isJava14"><matches string="${ant.java.version}" pattern="1[4-9]|[2-9][0-9]" /></condition> -->
23 <!-- <condition property="isJava15"><matches string="${ant.java.version}" pattern="1[5-9]|[2-9][0-9]" /></condition> -->
24 <condition property="isJava16"><matches string="${ant.java.version}" pattern="1[6-9]|[2-9][0-9]" /></condition>
25 <condition property="isJava17"><matches string="${ant.java.version}" pattern="1[7-9]|[2-9][0-9]" /></condition>
26 <!-- <condition property="isJava18"><matches string="${ant.java.version}" pattern="1[8-9]|[2-9][0-9]" /></condition> -->
27 <condition property="isJava19"><matches string="${ant.java.version}" pattern="19|[2-9][0-9]" /></condition>
28 <!-- <condition property="isJava20"><matches string="${ant.java.version}" pattern="[2-9][0-9]" /></condition> -->
29 <condition property="isJava21"><matches string="${ant.java.version}" pattern="2[1-9]|[3-9][0-9]" /></condition>
30 <!-- <condition property="isJava22"><matches string="${ant.java.version}" pattern="2[2-9]|[3-9][0-9]" /></condition> -->
31 <!-- <condition property="isJava23"><matches string="${ant.java.version}" pattern="2[3-9]|[3-9][0-9]" /></condition> -->
32 <condition property="isJava24"><matches string="${ant.java.version}" pattern="2[4-9]|[3-9][0-9]" /></condition>
33 <!-- <condition property="isJava25"><matches string="${ant.java.version}" pattern="2[5-9]|[3-9][0-9]" /></condition> -->
34 <!-- <condition property="isJava26"><matches string="${ant.java.version}" pattern="2[6-9]|[3-9][0-9]" /></condition> -->
35 </target>
36 <target name="init-ivy" depends="init-javaversions" description="Initialize dependency management system Apache Ivy">
37 <property name="ivy.version" value="2.5.3"/>
38 <dirname property="base.dir" file="${ant.file.josm}"/>
39 <property name="lib.dir" location="${base.dir}/lib"/>
40 <property name="tools.dir" location="${base.dir}/tools"/>
41 <property name="tools.ivy" location="${tools.dir}/ivy.xml"/>
42 <property name="ivy.jar.dir" location="${tools.dir}/ivy"/>
43 <property name="ivy.jar.file" location="${ivy.jar.dir}/ivy-${ivy.version}.jar"/>
44
•45 <!--
46 <mkdir dir="${ivy.jar.dir}"/>
47 <get src="https://josm.openstreetmap.de/repository/public/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"
48 dest="${ivy.jar.file}"
49 skipexisting="true"
50 />
51 <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar.file}"/>
•52 -->
53 </target>
54 <target name="init-properties" depends="init-javaversions" description="Initialize properties for the build">
55 <property environment="env"/>
56 <!-- Load properties in a target and not at top level, so this build file can be
57 imported from an IDE ant file (Netbeans) without messing up IDE properties.
58 When imported from another file, ${basedir} will point to the parent directory
59 of the importing ant file. Use ${base.dir} instead, which is always the parent
60 directory of this file. -->
61 <dirname property="base.dir" file="${ant.file.josm}"/>
62 <property name="test.dir" location="${base.dir}/test"/>
63 <property name="src.dir" location="${base.dir}/src"/>
64 <condition property="sign.jar">
65 <and>
66 <isset property="env.SIGN_ALIAS"/>
67 <isset property="env.SIGN_KEYSTORE"/>
68 <isset property="env.SIGN_KEYPASS"/>
69 <isset property="env.SIGN_STOREPASS"/>
70 <isset property="env.SIGN_TSA"/>
71 </and>
72 </condition>
73 <condition property="noJavaFX">
74 <or>
75 <isset property="env.JOSM_NOJAVAFX"/>
76 <not>
77 <available classname="javafx.scene.media.Media"/>
78 </not>
79 </or>
80 </condition>
81 <available property="svn.present" file="${base.dir}/.svn"/>
82 <available property="git.present" file="${base.dir}/.git"/>
83 <property name="build.dir" location="${base.dir}/build"/>
84 <property name="dist.dir" location="${base.dir}/dist"/>
85 <property name="resources.dir" location="${base.dir}/resources"/>
86 <property name="modules.dir" location="${dist.dir}/modules"/>
87 <property name="tools.dir" location="${base.dir}/tools"/>
88 <property name="pmd.dir" location="${tools.dir}/pmd"/>
89 <property name="checkstyle.dir" location="${tools.dir}/checkstyle"/>
90 <property name="spotbugs.dir" location="${tools.dir}/spotbugs"/>
91 <property name="javacc.home" location="${tools.dir}"/>
92 <property name="mapcss.dir" location="${src.dir}/org/openstreetmap/josm/gui/mappaint/mapcss"/>
93 <property name="proj-build.dir" location="${base.dir}/build2"/>
94 <property name="script-build.dir" location="${base.dir}/build2"/>
95 <property name="epsg.output" location="${resources.dir}/data/projection/custom-epsg"/>
•96 <property name="antcontrib.jar" value="/usr/share/java/ant-contrib.jar"/>
97 <property name="commons-lang3.jar" location="${tools.dir}/commons-lang3.jar"/>
98 <property name="dist.jar" location="${dist.dir}/josm-custom.jar"/>
99 <property name="dist-optimized.jar" location="${dist.dir}/josm-custom-optimized.jar"/>
100 <property name="dist-sources.jar" location="${dist.dir}/josm-custom-sources.jar"/>
101 <!-- When incrementing the minimum Java version, don't forget to update the Java versions users will update to
102 (PlatformHook#getJavaUrl, PlatformHook#startupSanityChecks and PlatformHook#warnSoonToBeUnsupportedJava) -->
103 <property name="java.lang.version" value="11" />
104 <property name="test.headless" value="true" />
105 <property name="noErrorProne" value="false"/>
106 <property name="jacoco.includes" value="org.openstreetmap.josm.*" />
107 <property name="jacoco.inclbootstrapclasses" value="false" />
108 <property name="jacoco.inclnolocationclasses" value="false" />
109 <property name="junit.printsummary" value="on" />
110 <property name="default-junit-includes" value="**/*Test.class"/>
111 <property name="default-junitIT-includes" value="**/*TestIT.class"/>
112 <!-- build parameter: compression level (ant -Dclevel=N)
113 N ranges from 0 (no compression) to 9 (maximum compression)
114 default: 9 -->
115 <condition property="clevel" value="${clevel}" else="9">
116 <isset property="clevel"/>
117 </condition>
118 <!-- Disable jacoco on Java 19+, see https://github.com/jacoco/jacoco/pull/1282 -->
119 <condition property="coverageByDefault">
120 <not>
121 <isset property="isJava19"/>
122 </not>
123 </condition>
124 <property name="java.library.dir" value="jmods" />
•125 <!-- Java classpath addition (all jar files to compile tests with this) -->
126 <path id="classpath">
127 <fileset dir="/usr/share/java">
128 <include name="gettext-commons.jar"/>
129 <include name="jmapviewer.jar"/>
130 </fileset>
131 </path>
132 <property name="classpathprop-colon" refid="classpath"/>
133 </target>
134 <target name="init-svn-revision-xml" if="svn.present" depends="init-properties"
135 description="Initialize the REVISION.XML file from SVN information">
136 <exec append="false" output="${base.dir}/REVISION.XML" executable="svn" dir="${base.dir}" resultproperty="svn.info.result">
137 <env key="LANG" value="C"/>
138 <arg value="info"/>
139 <arg value="--xml"/>
140 <arg value="."/>
141 </exec>
142 </target>
143 <target name="init-git-revision-xml" if="git.present" depends="init-properties"
144 description="Initialize the REVISION.XML file from git information">
145 <exec append="false" output="${base.dir}/REVISION.XML" executable="git" dir="${base.dir}">
146 <arg value="log"/>
147 <arg value="-1"/>
148 <arg value="--grep=git-svn-id"/>
149 <!--
150 %B: raw body (unwrapped subject and body)
151 %n: new line
152 %ai: author date, ISO 8601 format
153 -->
154 <arg value="--pretty=format:%B%n%ai"/>
155 <arg value="HEAD"/>
156 </exec>
157 <replaceregexp file="${base.dir}/REVISION.XML" flags="s"
158 match=".*git-svn-id: [^@]*@([0-9]+).*(\d{4}-\d{2}-\d{2}.\d{2}\:\d{2}\:\d{2}\s*[+-]\d{2}:?\d{2})\s*$"
159 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;"/>
160 </target>
•161 <target name="create-revision"
162 description="Create the REVISION file to be included in the distribution based on the latest SVN/Git commit">
•163 <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
164 <tstamp>
165 <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss"/>
166 </tstamp>
167 <property name="version.entry.commit.revision" value="UNKNOWN"/>
168 <property name="version.entry.commit.date" value="UNKNOWN"/>
169 <!-- add Build-Name: ... when making special builds, e.g. DEBIAN -->
170 <echo file="${resources.dir}/REVISION">
171 # automatically generated by JOSM build.xml - do not edit
172 Revision: ${version.entry.commit.revision}
173 Build-Date: ${build.tstamp}
•174 Is-Local-Build: false
175 Build-Name: Debian
176 Debian-Release: ${debian.version}
177 </echo>
178 </target>
179 <target name="check-schemas" unless="check-schemas.notRequired" depends="init-properties"
180 description="Check internal XML files against their XSD">
181 <schemavalidate file="${resources.dir}/data/defaultpresets.xml" >
182 <schema namespace="http://josm.openstreetmap.de/tagging-preset-1.0" file="${resources.dir}/data/tagging-preset.xsd" />
183 </schemavalidate>
184 </target>
•185 <target name="dist" depends="compile,epsg,copy-resources,check-schemas"
186 description="Main target that builds JOSM and checks XML against schemas">
187 <echo>Revision ${version.entry.commit.revision}</echo>
188 <copy file="CONTRIBUTION" todir="${build.dir}"/>
189 <copy file="README" todir="${build.dir}"/>
190 <copy file="LICENSE" todir="${build.dir}"/>
191 <copy file="gpl-2.0.txt" todir="${build.dir}"/>
192 <copy file="gpl-3.0.txt" todir="${build.dir}"/>
193 <!-- create josm-custom.jar -->
•194 <propertyregex property="classpathprop" input="${classpathprop-colon}" global="true" regexp=":" replace=" "/>
195 <jar destfile="${dist.jar}" basedir="${build.dir}" level="${clevel}">
196 <!-- add attribute excludes="**/*BZip2*,**/*Bzip2*" to create a non-bzip2 supporting jar -->
197 <manifest>
198 <attribute name="Main-class" value="org.openstreetmap.josm.gui.MainApplication"/>
•199 <attribute name="Main-Version" value="${version.entry.commit.revision}"/>
200 <attribute name="Main-Date" value="${version.entry.commit.date}"/>
201 <attribute name="Permissions" value="all-permissions"/>
202 <attribute name="Codebase" value="josm.openstreetmap.de"/>
203 <attribute name="Application-Name" value="JOSM - Java OpenStreetMap Editor"/>
•204 <attribute name="Debian-Release" value="${debian.version}"/>
205 <attribute name="Class-Path" value="${classpathprop}"/>
206 <!-- Java 9 stuff. Entries are safely ignored by Java 8 -->
207 <attribute name="Add-Exports" value="java.base/sun.security.action java.desktop/com.apple.eawt java.desktop/com.sun.imageio.spi java.desktop/com.sun.imageio.plugins.jpeg javafx.graphics/com.sun.javafx.application jdk.deploy/com.sun.deploy.config" />
208 <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" />
209 <!-- Indicate that this jar may have version specific classes. Only used in Java9+. -->
210 <attribute name="Multi-Release" value="true"/>
211 </manifest>
•212 <service type="jakarta.json.spi.JsonProvider">
213 <provider classname="org.eclipse.parsson.JsonProviderImpl"/>
214 </service>
215 <service type="org.apache.commons.jcs3.log.LogFactory">
216 <provider classname="org.apache.commons.jcs3.log.JulLogFactory"/>
217 <provider classname="org.apache.commons.jcs3.log.Log4j2Factory"/>
218 </service>
219 </jar>
220 <!-- Sign jar if all environment variables are set -->
221 <signjar jar="${dist.jar}" alias="${env.SIGN_ALIAS}" tsaurl="${env.SIGN_TSA}"
222 keystore="${env.SIGN_KEYSTORE}" storepass="${env.SIGN_STOREPASS}" keypass="${env.SIGN_KEYPASS}" if:set="sign.jar" />
223 </target>
224 <target name="javacc" depends="init" unless="javacc.notRequired" description="Compile the MapCSS compiler">
225 <mkdir dir="${mapcss.dir}/parsergen"/>
•226 <exec append="false" executable="javacc" failifexecutionfails="true">
227 <arg value="-DEBUG_PARSER=false"/>
228 <arg value="-DEBUG_TOKEN_MANAGER=false"/>
229 <arg value="-JDK_VERSION=1.${java.lang.version}"/>
230 <arg value="-GRAMMAR_ENCODING=UTF-8"/>
231 <arg value="-UNICODE_INPUT=true"/>
•232 <arg value="-OUTPUT_DIRECTORY=${mapcss.dir}/parsergen"/>
233 <arg value="${mapcss.dir}/MapCSSParser.jj"/>
•234 </exec>
235 </target>
236 <target name="javacc-openinghoursparser" depends="init" unless="javacc.notRequired">
237 <mkdir dir="${src.dir}/ch/poole/openinghoursparser/parsergen"/>
238 <exec append="false" executable="javacc" failifexecutionfails="true">
239 <arg value="-DEBUG_PARSER=false"/>
240 <arg value="-DEBUG_TOKEN_MANAGER=false"/>
241 <arg value="-JDK_VERSION=1.${java.lang.version}"/>
242 <arg value="-GRAMMAR_ENCODING=UTF-8"/>
243 <arg value="-UNICODE_INPUT=true"/>
244 <arg value="-OUTPUT_DIRECTORY=${src.dir}/ch/poole/openinghoursparser"/>
245 <arg value="${src.dir}/ch/poole/openinghoursparser/OpeningHoursParser.jj"/>
246 </exec>
247 </target>
248 <target name="compile-cots" depends="init,javacc-openinghoursparser" description="Compile third-party dependencies not retrieved with Ivy">
249 <!-- COTS -->
250 <javac srcdir="${src.dir}" classpathref="classpath"
251 includes="aQute/**,ch/**,com/**,jakarta/**,org/apache/commons/**,org/eclipse/**,org/jetbrains/annotations/**,org/osgi/**,org/tukaani/**"
252 excludes="**/package-info.java" nowarn="on" encoding="iso-8859-1"
253 destdir="${build.dir}" release="${java.lang.version}" debug="on" includeAntRuntime="false">
254 <!-- get rid of "internal proprietary API" warning -->
255 <compilerarg value="-XDignore.symbol.file"/>
256 <exclude name="ch/poole/openinghoursparser/DataTest.java"/>
257 <exclude name="ch/poole/openinghoursparser/UnitTest.java"/>
258 <exclude name="com/drew/imaging/FileTypeDetector*"/>
259 <exclude name="com/drew/imaging/ImageMetadataReader*"/>
260 <exclude name="com/drew/imaging/avi/**"/>
261 <exclude name="com/drew/imaging/bmp/**"/>
262 <exclude name="com/drew/imaging/eps/**"/>
263 <exclude name="com/drew/imaging/gif/**"/>
264 <exclude name="com/drew/imaging/heif/**"/>
265 <exclude name="com/drew/imaging/ico/**"/>
266 <exclude name="com/drew/imaging/mp3/**"/>
267 <exclude name="com/drew/imaging/mp4/**"/>
268 <exclude name="com/drew/imaging/pcx/**"/>
269 <exclude name="com/drew/imaging/psd/**"/>
270 <exclude name="com/drew/imaging/quicktime/**"/>
271 <exclude name="com/drew/imaging/raf/**"/>
272 <exclude name="com/drew/imaging/riff/**"/>
273 <exclude name="com/drew/imaging/wav/**"/>
274 <exclude name="com/drew/imaging/webp/**"/>
275 <exclude name="com/drew/metadata/avi/**"/>
276 <exclude name="com/drew/metadata/bmp/**"/>
277 <exclude name="com/drew/metadata/eps/**"/>
278 <exclude name="com/drew/metadata/gif/**"/>
279 <exclude name="com/drew/metadata/heif/**"/>
280 <exclude name="com/drew/metadata/ico/**"/>
281 <exclude name="com/drew/metadata/mov/**"/>
282 <exclude name="com/drew/metadata/mp3/**"/>
283 <exclude name="com/drew/metadata/mp4/**"/>
284 <exclude name="com/drew/metadata/pcx/**"/>
285 <exclude name="com/drew/metadata/wav/**"/>
286 <exclude name="com/drew/metadata/webp/**"/>
287 <exclude name="com/drew/tools/**"/>
288 <exclude name="org/apache/commons/compress/PasswordRequiredException*"/>
289 <exclude name="org/apache/commons/compress/archivers/**"/>
290 <exclude name="org/apache/commons/compress/changes/**"/>
291 <exclude name="org/apache/commons/compress/compressors/bzip2/BZip2Utils*"/>
292 <exclude name="org/apache/commons/compress/compressors/brotli/**"/>
293 <exclude name="org/apache/commons/compress/compressors/CompressorStreamFactory*"/>
294 <exclude name="org/apache/commons/compress/compressors/CompressorStreamProvider*"/>
295 <exclude name="org/apache/commons/compress/compressors/CompressorException*"/>
296 <exclude name="org/apache/commons/compress/compressors/FileNameUtil*"/>
297 <exclude name="org/apache/commons/compress/compressors/deflate/**"/>
298 <exclude name="org/apache/commons/compress/compressors/gzip/**"/>
299 <exclude name="org/apache/commons/compress/compressors/lz4/**"/>
300 <exclude name="org/apache/commons/compress/compressors/lzma/**"/>
301 <exclude name="org/apache/commons/compress/compressors/lz77support/**"/>
302 <exclude name="org/apache/commons/compress/compressors/pack200/**"/>
303 <exclude name="org/apache/commons/compress/compressors/snappy/**"/>
304 <exclude name="org/apache/commons/compress/compressors/xz/XZUtils*"/>
305 <exclude name="org/apache/commons/compress/compressors/z/**"/>
306 <exclude name="org/apache/commons/compress/compressors/zstandard/**"/>
307 <exclude name="org/apache/commons/compress/java/util/jar/Pack200*"/>
308 <exclude name="org/apache/commons/compress/harmony/pack200/**"/>
309 <exclude name="org/apache/commons/compress/harmony/unpack200/**"/>
310 <exclude name="org/apache/commons/compress/parallel/**"/>
311 <exclude name="org/apache/commons/compress/utils/ArchiveUtils*"/>
312 <exclude name="org/apache/commons/jcs3/auxiliary/disk/jdbc/**"/>
313 <exclude name="org/apache/commons/jcs3/auxiliary/remote/http/client/**"/>
314 <exclude name="org/apache/commons/jcs3/auxiliary/remote/http/server/RemoteHttpCacheServlet*"/>
315 <exclude name="org/apache/commons/jcs3/auxiliary/remote/server/RemoteCacheStartupServlet*"/>
316 <exclude name="org/apache/commons/jcs3/log/Log4j2Factory*"/>
317 <exclude name="org/apache/commons/jcs3/log/Log4j2LogAdapter*"/>
318 <exclude name="org/apache/commons/jcs3/utils/servlet/**"/>
319 <exclude name="org/jetbrains/annotations/Debug.java"/>
320 <exclude name="org/openstreetmap/gui/jmapviewer/Demo*"/>
321 </javac>
322 <copy todir="${build.dir}">
323 <fileset dir="${src.dir}" includes="ch/poole/**/*.properties" excludes="**/*.java"/>
324 </copy>
325 <!-- I18N -->
326 <ant dir="i18n" />
327 </target>
328 <macrodef name="call-javac-compile">
329 <attribute name="sourcepath" default=""/>
330 <attribute name="srcdir" default="${src.dir}"/>
331 <attribute name="fork" default="yes"/>
332 <attribute name="excludes" default=""/>
333 <attribute name="includes" default="**/*.java"/>
334 <attribute name="destdir" default="${build.dir}"/>
335 <attribute name="debug" default="on"/>
336 <attribute name="includeantruntime" default="false"/>
337 <attribute name="encoding" default="UTF-8"/>
338 <attribute name="release" default="${java.lang.version}"/>
339 <element name="cp-elements" optional="true"/>
340 <sequential>
341 <javac sourcepath="@{sourcepath}" srcdir="@{srcdir}" fork="@{fork}"
342 includes="@{includes}" excludes="@{excludes}" destdir="@{destdir}" release="@{release}"
343 debug="@{debug}" includeantruntime="@{includeantruntime}" encoding="@{encoding}">
344 <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
345 <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
346 <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
347 <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
348 <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
349 <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
350 <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
351 <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
352 <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
353 <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
354 <compilerarg line="-XDcompilePolicy=simple"/>
355 <compilerarg value="-processorpath"/>
356 <compilerarg value="${toString:errorprone.classpath}:${toString:semanticdb.classpath}"/>
357 <compilerarg value="-Xlint:cast"/>
358 <compilerarg value="-Xlint:deprecation"/>
359 <compilerarg value="-Xlint:dep-ann"/>
360 <compilerarg value="-Xlint:divzero"/>
361 <compilerarg value="-Xlint:empty"/>
362 <compilerarg value="-Xlint:finally"/>
363 <compilerarg value="-Xlint:overrides"/>
364 <!--<compilerarg value="-Xlint:rawtypes"/>-->
365 <compilerarg value="-Xlint:static"/>
366 <compilerarg value="-Xlint:try"/>
367 <compilerarg value="-Xlint:unchecked"/>
368 <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
369 <compilerarg value="-XDignore.symbol.file"/>
370 <!-- -XepExcludedPaths:.*/parsergen/.*: see #16860 - Resolve JavaCC using Apache Ivy -->
371 <!-- ReferenceEquality: see #12472, fix #13230, fix #13225, fix #13228 - disable ReferenceEquality warning + partial revert of r10656 + r10659, causes too much problems -->
372 <!-- FutureReturnValueIgnored: update to error_prone 2.0.18 (disabled on purpose?) -->
373 <!-- JdkObsolete: see #11924 - see #15560 - support jdk10+ in build.xml, update to proguard 6.0beta1 and error_prone 2.1.2 (disabled due to crashes) -->
374 <!-- EqualsGetClass, UndefinedEquals: see #16498 - update to error_prone 2.3.2-20180817.184126-35 to test JDK 12 compatibility. (disabled due to crashes?) -->
375 <!-- BadImport, AnnotateFormatMethod: see #17516 - update to error-prone 2.3.5-SNAPSHOT plus following patches for Java 13 compatibility (disabled due to crashes?) -->
376 <!-- JavaUtilDate, DoNotCallSuggester, BanSerializableRead: see #19724 - update to error-prone 2.5.1, checkstyle 8.36, spotbugs 4.2.1 (disabled due to crashes?) -->
377 <!-- InlineMeSuggester: See #20522 - Disable https://errorprone.info/bugpattern/InlineMeSuggester (maybe it crashed?) -->
378 <!-- LongDoubleConversion: Disable due to conflicting with Sonar settings -->
379 <compilerarg value="-Xplugin:ErrorProne -XepExcludedPaths:.*/parsergen/.* -Xep:ReferenceEquality:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:JdkObsolete:OFF -Xep:EqualsGetClass:OFF -Xep:UndefinedEquals:OFF -Xep:BadImport:OFF -Xep:AnnotateFormatMethod:OFF -Xep:JavaUtilDate:OFF -Xep:DoNotCallSuggester:OFF -Xep:BanSerializableRead:OFF -Xep:InlineMeSuggester:OFF -Xep:LongDoubleConversion:OFF" unless:set="noErrorProne"/>
380 <compilerarg line="-Xmaxwarns 1000"/>
381 <compilerarg value="-Xplugin:semanticdb -sourceroot:@{srcdir} -targetroot:${build.dir}/semanticdb" if:set="lsif" />
382 <classpath>
383 <path refid="runtime.path"/>
384 <cp-elements/>
385 </classpath>
386 </javac>
387 </sequential>
388 </macrodef>
389 <macrodef name="call-javac-compile-mrjar">
390 <!--
391 See https://openjdk.java.net/jeps/238 for the specification
392 The big bits are that the version specific files should be in META-INF/versions/${javaVersion}/
393 using the same package scheme. And that the files in the version specific directories are *full*
394 implementations of the class they are replacing.
395 -->
396 <attribute name="release"/>
397 <sequential>
398 <condition property="java@{release}DirExists">
399 <and>
400 <isset property="isJava@{release}"/>
401 <resourceexists>
402 <file file="${src.dir}/main/java-@{release}"/>
403 </resourceexists>
404 </and>
405 </condition>
406 <echo message="Compiling Java @{release} files" if:true="${java@{release}DirExists}"/>
407 <mkdir dir="${build.dir}/META-INF/versions/@{release}" if:true="${java@{release}DirExists}"/>
408 <call-javac-compile srcdir="${src.dir}/main/java-@{release}" destdir="${build.dir}/META-INF/versions/@{release}" release="@{release}" if:true="${java@{release}DirExists}">
409 <cp-elements>
410 <pathelement path="${build.dir}"/>
411 </cp-elements>
412 </call-javac-compile>
413 </sequential>
414 </macrodef>
•415 <target name="compile" depends="init,javacc,compile-cots" unless="compile.notRequired" description="Compile JOSM">
416 <!--
417 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="errorprone.classpath" conf="errorprone"/>
418 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="errorprone_javac.classpath" conf="errorprone_javac"/>
•419 -->
420 <!-- JOSM -->
•421 <!--
422 <call-javac-compile excludes="**/package-info.java,**/module-info.java,main/**" release="${java.lang.version}"/>
•423 -->
424 <!-- Java 11 specific files (2018-09 LTS) -->
•425 <!--
426 <call-javac-compile-mrjar release="11"/>
•427 -->
428 <!-- Java 17 specific files (2021-09 LTS) -->
•429 <!--
430 <call-javac-compile-mrjar release="17"/>
•431 -->
432 <!-- Java 21 specific files (2023-09 LTS) -->
•433 <!--
434 <call-javac-compile-mrjar release="21"/>
•435 -->
436 <javac sourcepath="" srcdir="${src.dir}" fork="yes" classpathref="classpath"
437 excludes="aQute/**,ch/**,com/**,jakarta/**,org/apache/commons/**,org/eclipse/**,org/intellij/**,org/jetbrains/annotations/**,org/openstreetmap/gui/jmapviewer/**,org/osgi/**,org/tukaani/**,**/package-info.java"
438 destdir="${build.dir}" release="${java.lang.version}" debug="on" includeantruntime="false" encoding="UTF-8">
439 <compilerarg value="-Xlint:cast"/>
440 <compilerarg value="-Xlint:deprecation"/>
441 <compilerarg value="-Xlint:dep-ann"/>
442 <compilerarg value="-Xlint:divzero"/>
443 <compilerarg value="-Xlint:empty"/>
444 <compilerarg value="-Xlint:finally"/>
445 <compilerarg value="-Xlint:overrides"/>
446 <!--<compilerarg value="-Xlint:rawtypes"/>-->
447 <compilerarg value="-Xlint:static"/>
448 <compilerarg value="-Xlint:try"/>
449 <compilerarg value="-Xlint:unchecked"/>
450 <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
451 <compilerarg value="-XDignore.symbol.file"/>
452 </javac>
453 </target>
454 <target name="create-resources" depends="create-revision" description="Create generated resource files">
455 <copy todir="${resources.dir}">
456 <file file="CONTRIBUTION"/>
457 <file file="README"/>
458 <file file="LICENSE"/>
459 </copy>
460 </target>
461 <target name="copy-resources" depends="create-resources" description="Copy resource files to build directory">
462 <copy todir="build" failonerror="no" includeemptydirs="no">
463 <fileset dir="${resources.dir}"/>
464 </copy>
465 </target>
466 <target name="init" depends="init-properties,resolve" description="Initialize the build">
467 <uptodate property="javacc.notRequired" targetfile="${mapcss.dir}/parsergen/MapCSSParser.java" >
468 <srcfiles dir="${mapcss.dir}" includes="MapCSSParser.jj"/>
469 </uptodate>
470 <uptodate property="epsg.notRequired" targetfile="${epsg.output}">
471 <srcfiles file="${base.dir}/scripts/BuildProjectionDefinitions.java"/>
472 <srcfiles dir="nodist/data/projection"/>
473 </uptodate>
474 <mkdir dir="${build.dir}"/>
475 <mkdir dir="${dist.dir}"/>
•476 <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${antcontrib.jar}"/>
477 </target>
478 <target name="javadoc" depends="init" description="Generate API documentation from JOSM source files">
479 <javadoc destdir="javadoc"
480 sourcepath="${src.dir}"
481 classpathref="compile.path"
482 encoding="UTF-8"
483 packagenames="org.openstreetmap.josm.*"
484 excludepackagenames="org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.*"
485 windowtitle="JOSM"
486 use="true"
487 private="true"
488 linksource="true"
489 author="false">
490 <link href="https://docs.oracle.com/en/java/javase/11/docs/api" />
491 <doctitle><![CDATA[<h2>
492 <img src="https://josm.openstreetmap.de/svn/trunk/nodist/images/logo/header.png" style="vertical-align: middle;" alt="JOSM">
493 &mdash; Javadoc
494 </h2>]]></doctitle>
495 <bottom><![CDATA[<a href="https://josm.openstreetmap.de/">JOSM</a>]]></bottom>
496 <!-- Disable HTML checking until we switch to Java13+, see https://bugs.openjdk.java.net/browse/JDK-8223552 -->
497 <arg value="-Xdoclint:-html" if:set="isJava13" />
498 <arg value="-html5" />
499 <arg value="--add-exports" unless:set="noJavaFX" />
500 <arg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" unless:set="noJavaFX" />
501 </javadoc>
502 </target>
503 <target name="cleanfull" depends="init-properties" description="Delete all generated files">
504 <exec executable="svn" dir="${basedir}">
505 <arg value="cleanup"/>
506 <arg value="--remove-ignored"/>
507 </exec>
508 </target>
509 <target name="clean" depends="init-properties" description="Delete all build files">
510 <delete dir="${build.dir}"/>
511 <delete dir="${proj-build.dir}"/>
512 <delete dir="${script-build.dir}"/>
513 <delete dir="${dist.dir}"/>
514 <delete dir="${mapcss.dir}/parsergen"/>
515 <delete file="${src.dir}/org/w3/_2001/xmlschema/Adapter1.java"/>
516 <delete dir="${src.dir}/org/openstreetmap/josm/data/imagery/types"/>
517 <delete file="${epsg.output}"/>
518 <delete file="${pmd.dir}/cache"/>
•519 <ant target="clean" dir="i18n"/>
520 </target>
521 <macrodef name="init-test-preferences">
522 <attribute name="testfamily"/>
523 <sequential>
524 <copy file="${test.dir}/config/preferences.template.xml" tofile="${test.dir}/config/@{testfamily}-josm.home/preferences.xml"/>
525 <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/>
526 <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/>
527 </sequential>
528 </macrodef>
529 <target name="test-init" depends="init" description="Initialize the tests">
530 <mkdir dir="${test.dir}/build"/>
531 <mkdir dir="${test.dir}/build/unit"/>
532 <mkdir dir="${test.dir}/build/functional"/>
533 <mkdir dir="${test.dir}/build/performance"/>
534 <mkdir dir="${test.dir}/report"/>
535 <init-test-preferences testfamily="unit"/>
536 <init-test-preferences testfamily="functional"/>
537 <init-test-preferences testfamily="performance"/>
538 <path id="test.classpath">
539 <path refid="test.path"/>
540 <pathelement path="${build.dir}"/>
541 <pathelement path="${resources.dir}"/>
542 </path>
543 <ivy:retrieve log="download-only" pattern="${test.dir}/lib/[artifact].[ext]" conf="junit5-system-exit"/>
544 <ivy:retrieve log="download-only" pattern="${test.dir}/lib/[artifact].[ext]" conf="jmockit"/>
545 <ivy:retrieve log="download-only" pattern="${tools.dir}/[artifact].[ext]" conf="commonslang"/>
546 <ivy:retrieve log="download-only" pattern="${tools.dir}/[conf].[ext]" conf="jacocoant"/>
547 <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="${tools.dir}/jacocoant.jar" />
548 </target>
549 <target name="test-clean" depends="init-properties" description="Delete all built test files">
550 <delete dir="${test.dir}/build"/>
551 <delete dir="${test.dir}/report"/>
552 <delete file="${test.dir}/jacoco.exec" />
553 <delete file="${test.dir}/jacocoIT.exec" />
554 <delete file="${test.dir}/config/unit-josm.home" failonerror="false"/>
555 <delete file="${test.dir}/config/functional-josm.home" failonerror="false"/>
556 <delete file="${test.dir}/config/performance-josm.home" failonerror="false"/>
557 </target>
558 <macrodef name="call-javac">
559 <attribute name="testfamily"/>
560 <element name="cp-elements"/>
561 <sequential>
562 <javac srcdir="${test.dir}/@{testfamily}" destdir="${test.dir}/build/@{testfamily}"
563 release="${java.lang.version}" debug="on"
564 includeantruntime="false" encoding="UTF-8">
565 <compilerarg value="-Xlint:all"/>
566 <compilerarg value="-Xlint:-path"/><!-- Suppress "bad path element .../xmpcore-6.0.6.jar: no such file or directory" warning, see https://github.com/drewnoakes/metadata-extractor/pull/483 -->
567 <compilerarg value="-Xlint:-serial"/>
568 <classpath>
569 <cp-elements/>
570 </classpath>
571 </javac>
572 <copy todir="${test.dir}/build/@{testfamily}/META-INF">
573 <fileset dir="${test.dir}/data/META-INF"/>
574 </copy>
575 </sequential>
576 </macrodef>
577 <target name="test-compile" depends="test-init,compile,extract-libraries,epsg,copy-resources" description="Compile all tests">
578 <call-javac testfamily="unit">
579 <cp-elements>
580 <path refid="test.classpath"/>
581 </cp-elements>
582 </call-javac>
583 <call-javac testfamily="functional">
584 <cp-elements>
585 <path refid="test.classpath"/>
586 <pathelement path="${test.dir}/build/unit"/>
587 </cp-elements>
588 </call-javac>
589 <call-javac testfamily="performance">
590 <cp-elements>
591 <path refid="test.classpath"/>
592 <pathelement path="${test.dir}/build/unit"/>
593 </cp-elements>
594 </call-javac>
595 </target>
596 <macrodef name="call-junit">
597 <attribute name="testfamily"/>
598 <attribute name="testITsuffix" default=""/>
599 <attribute name="coverage" default="${coverageByDefault}"/>
600 <attribute name="includes" default="${default-junit@{testITsuffix}-includes}"/>
601 <attribute name="excludes" default="${default-junit@{testITsuffix}-excludes}"/>
602 <sequential>
603 <echo message="Running @{testfamily}@{testITsuffix} tests with JUnit"/>
604 <jacoco:agent destfile="${test.dir}/jacoco@{testITsuffix}.exec" enabled="@{coverage}" includes="${jacoco.includes}" dumponexit="true"
605 inclbootstrapclasses="${jacoco.inclbootstrapclasses}" inclnolocationclasses="${jacoco.inclnolocationclasses}"
606 property="jacocoagent@{testfamily}@{testITsuffix}" if:true="@{coverage}"/>
607 <junitlauncher printsummary="${junit.printsummary}" failureproperty="test.@{testfamily}@{testITsuffix}.failed">
608 <classpath>
609 <path refid="test.classpath"/>
610 <pathelement path="${test.dir}/build/unit"/> <!-- required for functional/etc to have JOSMTestRules -->
611 <pathelement path="${test.dir}/build/@{testfamily}"/>
612 </classpath>
613 <testclasses outputDir="${test.dir}/report">
614 <fileset dir="${test.dir}/build/@{testfamily}" includes="@{includes}" excludes="@{excludes}"/>
615 <fork>
616 <jvmarg value="${jacocoagent@{testfamily}@{testITsuffix}}" if:set="jacocoagent@{testfamily}@{testITsuffix}" />
617 <jvmarg value="-Dfile.encoding=UTF-8"/>
618 <jvmarg value="-Djava.locale.providers=SPI,CLDR" />
619 <jvmarg value="-Djava.security.manager=allow" if:set="isJava17" unless:set="isJava24" />
620 <jvmarg value="-javaagent:${test.dir}/lib/junit5-system-exit.jar" if:set="isJava17"/>
621 <jvmarg value="-javaagent:${test.dir}/lib/jmockit.jar"/>
622 <jvmarg value="-Djunit.jupiter.extensions.autodetection.enabled=true"/>
623 <jvmarg value="-Djunit.jupiter.execution.parallel.enabled=true"/>
624 <jvmarg value="--add-exports" unless:set="noJavaFX" />
625 <jvmarg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" unless:set="noJavaFX" />
626 <jvmarg value="--add-opens" />
627 <jvmarg value="java.base/java.io=ALL-UNNAMED" />
628 <jvmarg value="--add-opens" />
629 <jvmarg value="java.base/java.lang=ALL-UNNAMED" />
630 <jvmarg value="--add-opens" />
631 <jvmarg value="java.base/java.nio=ALL-UNNAMED" />
632 <jvmarg value="--add-opens" />
633 <jvmarg value="java.base/java.text=ALL-UNNAMED" />
634 <jvmarg value="--add-opens" />
635 <jvmarg value="java.base/java.util=ALL-UNNAMED" />
636 <jvmarg value="--add-opens" />
637 <jvmarg value="java.base/jdk.internal.loader=ALL-UNNAMED" />
638 <jvmarg value="--add-opens" />
639 <jvmarg value="java.desktop/java.awt=ALL-UNNAMED" />
640 <jvmarg value="--add-opens" />
641 <jvmarg value="java.prefs/java.util.prefs=ALL-UNNAMED" />
642 <sysproperty key="josm.home" value="${test.dir}/config/@{testfamily}-josm.home"/>
643 <sysproperty key="josm.test.data" value="${test.dir}/data"/>
644 <sysproperty key="java.awt.headless" value="${test.headless}"/>
645 <sysproperty key="java.security.manager" value="allow" if:set="isJava17" unless:set="isJava24" />
646 <sysproperty key="glass.platform" value="Monocle"/>
647 <sysproperty key="monocle.platform" value="Headless"/>
648 <sysproperty key="prism.order" value="sw"/>
649 <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
650 <sysproperty key="junit.jupiter.execution.parallel.enabled" value="${junit.jupiter.execution.parallel.enabled}" if:set="junit.jupiter.execution.parallel.enabled"/>
651 <sysproperty key="junit.jupiter.execution.parallel.mode.default" value="${junit.jupiter.execution.parallel.mode.default}" if:set="junit.jupiter.execution.parallel.mode.default"/>
652 <sysproperty key="junit.jupiter.execution.parallel.mode.classes.default" value="${junit.jupiter.execution.parallel.mode.classes.default}" if:set="junit.jupiter.execution.parallel.mode.classes.default"/>
653 </fork>
654 <listener type="legacy-brief" sendSysOut="true" sendSysErr="true"/>
655 <listener type="legacy-plain" />
656 <listener type="legacy-xml" />
657 </testclasses>
658 </junitlauncher>
659 </sequential>
660 </macrodef>
661 <target name="test" depends="test-compile" unless="test.notRequired"
662 description="Run unit and functional tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
663 <call-junit testfamily="unit"/>
664 <call-junit testfamily="functional"/>
665 </target>
666 <target name="test-hardfail" depends="test" description="Run 'test' target but abort if tests failed">
667 <fail message="'test' failed">
668 <condition>
669 <or>
670 <isset property="test.unit.failed"/>
671 <isset property="test.functional.failed"/>
672 </or>
673 </condition>
674 </fail>
675 </target>
676 <target name="test-unit" depends="test-compile" unless="test-unit.notRequired"
677 description="Run unit tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
678 <call-junit testfamily="unit"/>
679 </target>
680 <target name="test-unit-hardfail" depends="test-unit" description="Run 'test-unit' target but abort if tests failed">
681 <fail message="'test-unit' failed" if="test.unit.failed"/>
682 </target>
683 <target name="test-it" depends="test-compile,create-revision" unless="test-it.notRequired"
684 description="Run integration tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
685 <call-junit testfamily="unit" testITsuffix="IT"/>
686 <call-junit testfamily="functional" testITsuffix="IT"/>
687 </target>
688 <target name="test-it-hardfail" depends="test-it" description="Run 'test-it' target but abort if tests failed">
689 <fail message="'test-it' failed">
690 <condition>
691 <or>
692 <isset property="test.unitIT.failed"/>
693 <isset property="test.functionalIT.failed"/>
694 </or>
695 </condition>
696 </fail>
697 </target>
698 <target name="test-perf" depends="test-compile" unless="test-perf.notRequired"
699 description="Run performance tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
700 <call-junit testfamily="performance" coverage="false"/>
701 </target>
702 <target name="test-perf-hardfail" depends="test-perf" description="Run 'test-perf' target but abort if tests failed">
703 <fail message="'test-perf' failed" if="test.performance.failed"/>
704 </target>
705 <target name="test-html" depends="test, test-it, test-perf" description="Generate HTML, CSV and XML test reports">
706 <!-- May require additional ant dependencies like ant-trax package -->
707 <junitreport todir="${test.dir}/report">
708 <fileset dir="${test.dir}/report">
709 <include name="TEST-*.xml"/>
710 </fileset>
711 <report todir="${test.dir}/report/html"/>
712 </junitreport>
713 <jacoco:report>
714 <executiondata>
715 <fileset dir="${test.dir}" includes="*.exec"/>
716 </executiondata>
717 <structure name="JOSM Test Coverage">
718 <classfiles>
719 <fileset dir="${build.dir}" includes="org/openstreetmap/"/>
720 </classfiles>
721 <sourcefiles encoding="UTF-8">
722 <fileset dir="${src.dir}" includes="org/openstreetmap/"/>
723 </sourcefiles>
724 </structure>
725 <html destdir="${test.dir}/report/jacoco"/>
726 <xml destfile="${test.dir}/report/jacoco.xml"/>
727 <csv destfile="${test.dir}/report/jacoco.csv"/>
728 </jacoco:report>
729 </target>
730 <target name="dist-optimized" depends="dist" description="Build an optimized JOSM distribution file">
731 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="proguard.classpath" conf="proguard"/>
732 <taskdef resource="proguard/ant/task.properties" classpathref="proguard.classpath"/>
733 <proguard>
734 -injars ${dist.jar}
735 -outjars ${dist-optimized.jar}
736
737 -libraryjars ${java.home}/${java.library.dir}
738
739 -dontoptimize
740 -dontobfuscate
741 -dontwarn org.jetbrains.annotations.**
742
743 # jsvg (see #24793) references these compile-time-only annotations (OSGi/JPMS bundle
744 # metadata, errorprone) which are absent at runtime; jsvg works fine without them.
745 -dontwarn org.osgi.annotation.bundle.**
746 -dontwarn aQute.bnd.annotation.**
747 -dontwarn com.google.errorprone.annotations.**
748 -dontwarn java.lang.invoke.MethodHandle
749
750 # These options probably are not necessary (and make processing a bit slower)
751 -dontskipnonpubliclibraryclasses
752 -dontskipnonpubliclibraryclassmembers
753
754 -keepclasseswithmembers public class org.openstreetmap.josm.gui.MainApplication {
755 public static void main(java.lang.String[]);
756 }
757
758 -keep class * extends org.openstreetmap.josm.io.FileImporter
759 -keep class * extends org.openstreetmap.josm.io.FileExporter
760 -keep class org.openstreetmap.josm.actions.search.SearchCompiler$Never
761 -keep class org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory$PseudoClasses {
762 static boolean *(org.openstreetmap.josm.gui.mappaint.Environment);
763 }
764
765 -keepclassmembers enum * {
766 public static **[] values();
767 public static ** valueOf(java.lang.String);
768 }
769
770 # Keep unused public classes and methods (needed for plugins)
771 -keep public class * {
772 public protected *;
773 }
774
775 # Keep serialization code
776 -keepclassmembers class * implements java.io.Serializable {
777 static final long serialVersionUID;
778 private static final java.io.ObjectStreamField[] serialPersistentFields;
779 private void writeObject(java.io.ObjectOutputStream);
780 private void readObject(java.io.ObjectInputStream);
781 java.lang.Object writeReplace();
782 java.lang.Object readResolve();
783 }
784
785 # Disable annoying [proguard] Note: the configuration keeps the entry point '...', but not the descriptor class '...'.
786 # This note should not be a problem as we don't use obfuscation
787 -dontnote
788 </proguard>
789 </target>
790 <target name="dist-optimized-report" depends="dist-optimized">
791 <!-- generate difference report between optimized jar and normal one -->
792 <exec executable="perl" dir="${basedir}">
793 <arg value="${tools.dir}/japicc/japi-compliance-checker.pl"/>
794 <arg value="--lib=JOSM"/>
795 <arg value="--keep-internal"/>
796 <arg value="--v1=${version.entry.commit.revision}"/>
797 <arg value="--v2=${version.entry.commit.revision}-optimized"/>
798 <arg value="--report-path=${dist.dir}/compat_report.html"/>
799 <arg value="${dist.jar}"/>
800 <arg value="${dist-optimized.jar}"/>
801 </exec>
802 </target>
803 <target name="check-plugins" depends="dist-optimized" description="Check of plugins binary compatibility">
804 <local name="dir"/>
805 <local name="plugins"/>
806 <property name="dir" value="plugin-check"/>
807 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="animal.classpath" conf="animal"/>
808 <typedef uri="antlib:org.codehaus.mojo.animal_sniffer">
809 <classpath refid="animal.classpath"/>
810 </typedef>
811 <delete dir="${dir}" failonerror="false"/>
812 <mkdir dir="${dir}"/>
813 <!-- List of deprecated plugins -->
814 <loadfile property="deprecated-plugins" srcFile="${src.dir}/org/openstreetmap/josm/plugins/PluginHandler.java">
815 <filterchain>
816 <linecontains>
817 <contains value="new DeprecatedPlugin("/>
818 </linecontains>
819 <tokenfilter>
820 <replaceregex pattern=".*new DeprecatedPlugin\(&quot;(.+?)&quot;.*" replace="\1|" flags="gi"/>
821 </tokenfilter>
822 <striplinebreaks/>
823 <tokenfilter>
824 <replaceregex pattern="\|$" replace="" flags="gi"/>
825 </tokenfilter>
826 </filterchain>
827 </loadfile>
828 <!-- Download list of plugins -->
829 <loadresource property="plugins">
830 <url url="https://josm.openstreetmap.de/pluginicons?minjava=${java.lang.version}&amp;noparams=1"/>
831 <filterchain>
832 <linecontainsregexp negate="true">
833 <regexp pattern="${deprecated-plugins}"/>
834 </linecontainsregexp>
835 <tokenfilter>
836 <replaceregex pattern="^.*;" replace="" flags="gi"/>
837 </tokenfilter>
838 </filterchain>
839 </loadresource>
840 <!-- Delete files that are not in plugin list (like old plugins) -->
841 <loadresource property="file-list">
842 <propertyresource name="plugins"/>
843 <filterchain>
844 <tokenfilter>
845 <replaceregex pattern="^.*/(.*)$" replace="\1\|" flags=""/>
846 </tokenfilter>
847 <striplinebreaks/>
848 <tokenfilter>
849 <replaceregex pattern="\|$" replace="" flags="gi"/>
850 </tokenfilter>
851 </filterchain>
852 </loadresource>
853 <delete>
854 <restrict>
855 <fileset dir="${dir}"/>
856 <not>
857 <name regex="${file-list}"/>
858 </not>
859 </restrict>
860 </delete>
861 <!-- Download plugins -->
862 <copy todir="${dir}" flatten="true" verbose="true" failonerror="false">
863 <resourcelist>
864 <string value="${plugins}"/>
865 </resourcelist>
866 </copy>
867 <!-- Check plugins -->
868 <as:build-signatures destfile="${dir}/api.sig">
869 <path>
870 <fileset file="${dist-optimized.jar}"/>
871 <fileset dir="${java.home}/${java.library.dir}"/>
872 </path>
873 </as:build-signatures>
874 <as:check-signature signature="${dir}/api.sig" failonerror="false">
875 <ignore classname="afu.*"/>
876 <ignore classname="android.*"/>
877 <ignore classname="au.*"/>
878 <ignore classname="com.*"/>
879 <ignore classname="de.*"/>
880 <ignore classname="edu.*"/>
881 <ignore classname="groovy.*"/>
882 <ignore classname="io.*"/>
883 <ignore classname="it.*"/>
884 <ignore classname="java.lang.invoke.MethodHandle"/>
885 <ignore classname="java.nio.ByteBuffer"/>
886 <ignore classname="java.nio.FloatBuffer"/>
887 <ignore classname="java.util.list.kotlin.*"/>
888 <ignore classname="javax.*"/>
889 <ignore classname="jdk.swing.interop.*"/>
890 <ignore classname="jogamp.*"/>
891 <ignore classname="junit.*"/>
892 <ignore classname="kdu_jni.*"/>
893 <ignore classname="kotlin.*"/>
894 <ignore classname="net.*"/>
895 <ignore classname="netscape.*"/>
896 <ignore classname="nu.*"/>
897 <ignore classname="oracle.*"/>
898 <ignore classname="org.apache.*"/>
899 <ignore classname="org.bouncycastle.*"/>
900 <ignore classname="org.checkerframework.*"/>
901 <ignore classname="org.codehaus.*"/>
902 <ignore classname="org.conscrypt.*"/>
903 <ignore classname="org.dom4j.*"/>
904 <ignore classname="org.eclipse.*"/>
905 <ignore classname="org.ejml.*"/>
906 <ignore classname="org.fusesource.*"/>
907 <ignore classname="org.gdal.*"/>
908 <ignore classname="org.geotools.data.h2.*"/>
909 <ignore classname="org.geotools.gce.imagemosaic.*"/>
910 <ignore classname="org.hibernate.*"/>
911 <ignore classname="org.hsqldb.*"/>
912 <ignore classname="org.ibex.*"/>
913 <ignore classname="org.iso_relax.*"/>
914 <ignore classname="org.jaitools.*"/>
915 <ignore classname="org.jaxen.*"/>
916 <ignore classname="org.jboss.*"/>
917 <ignore classname="org.jctools.*"/>
918 <ignore classname="org.jdom.*"/>
919 <ignore classname="org.jdom2.*"/>
920 <ignore classname="org.jfree.*"/>
921 <ignore classname="org.jgraph.*"/>
922 <ignore classname="org.joda.*"/>
923 <ignore classname="org.json.*"/>
924 <ignore classname="org.junit.*"/>
925 <ignore classname="org.jvnet.*"/>
926 <ignore classname="org.kxml2.*"/>
927 <ignore classname="org.locationtech.*"/>
928 <ignore classname="org.mozilla.*"/>
929 <ignore classname="org.objectweb.*"/>
930 <ignore classname="org.opentest4j.*"/>
931 <ignore classname="org.osgi.*"/>
932 <ignore classname="org.postgresql.*"/>
933 <ignore classname="org.python.*"/>
934 <ignore classname="org.seasar.*"/>
935 <ignore classname="org.slf4j.*"/>
936 <ignore classname="org.springframework.*"/>
937 <ignore classname="org.testng.*"/>
938 <ignore classname="org.w3c.*"/>
939 <ignore classname="org.zeromq.*"/>
940 <ignore classname="waffle.*"/>
941 <!-- Our installers include javafx -->
942 <ignore classname="javafx.*"/>
943 <!-- plugins used by another ones -->
944 <ignore classname="org.openstreetmap.josm.plugins.geotools.*"/>
945 <ignore classname="org.openstreetmap.josm.plugins.jaxb.*"/>
946 <ignore classname="org.openstreetmap.josm.plugins.jna.*"/>
947 <ignore classname="org.openstreetmap.josm.plugins.jts.*"/>
948 <ignore classname="org.openstreetmap.josm.plugins.log4j.*"/>
949 <ignore classname="org.openstreetmap.josm.plugins.openjfx.*"/>
950 <ignore classname="org.openstreetmap.josm.plugins.utilsplugin2.*"/>
951 <ignore classname="sun.*"/>
952 <path path="${dir}"/>
953 </as:check-signature>
954 </target>
955
956 <target name="script-compile" depends="test-compile" description="Compile all scripts">
957 <javac sourcepath="" srcdir="${base.dir}/scripts" failonerror="true" includes="*.java"
958 destdir="${script-build.dir}" release="${java.lang.version}" debug="on"
959 includeantruntime="false" encoding="UTF-8">
960 <classpath>
961 <pathelement path="${build.dir}"/>
962 <pathelement path="${test.dir}/build/unit"/>
963 </classpath>
964 </javac>
965 </target>
966
967 <macrodef name="_taginfo">
968 <attribute name="type"/>
969 <attribute name="output"/>
970 <sequential>
971 <echo message="Generating Taginfo for type @{type} to @{output}"/>
972 <java classname="TagInfoExtract" failonerror="true" fork="false">
973 <sysproperty key="java.awt.headless" value="true"/>
974 <classpath>
975 <pathelement path="${build.dir}"/>
976 <pathelement path="${script-build.dir}"/>
977 </classpath>
978 <arg value="--type"/>
979 <arg value="@{type}"/>
980 <arg value="--noexit"/>
981 <arg value="--imgurlprefix"/>
982 <arg value="http://josm.openstreetmap.de/download/taginfo/taginfo-img"/>
983 <arg value="--output"/>
984 <arg value="@{output}"/>
985 </java>
986 </sequential>
987 </macrodef>
988
989 <target name="taginfo" depends="script-compile" description="Generate project files Taginfo">
990 <_taginfo type="mappaint" output="taginfo_style.json"/>
991 <_taginfo type="presets" output="taginfo_presets.json"/>
992 <_taginfo type="external_presets" output="taginfo_external_presets.json"/>
993 </target>
994
995 <target name="imageryindex" depends="script-compile" description="Check editor imagery difference">
996 <echo message="Checking editor imagery difference"/>
997 <java classname="SyncEditorLayerIndex" failonerror="true" fork="false">
998 <classpath>
999 <pathelement path="${build.dir}"/>
1000 <pathelement path="${script-build.dir}"/>
1001 </classpath>
1002 <arg value="--noeli"/>
1003 <arg value="-p"/>
1004 <arg value="imagery_eliout.imagery.xml"/>
1005 <arg value="-q"/>
1006 <arg value="imagery_josmout.imagery.xml"/>
1007 </java>
1008 </target>
1009
1010 <target name="imageryindexdownload" description="Download and check editor imagery">
1011 <exec append="false" executable="wget" failifexecutionfails="true">
1012 <arg value="https://josm.openstreetmap.de/maps"/>
1013 <arg value="-O"/>
1014 <arg value="imagery_josm.imagery.xml"/>
1015 <arg value="--unlink"/>
1016 </exec>
1017 <exec append="false" executable="wget" failifexecutionfails="true">
1018 <arg value="https://josm.openstreetmap.de/wiki/ImageryCompareIgnores?format=txt"/>
1019 <arg value="-O"/>
1020 <arg value="imagery_josm.ignores.txt"/>
1021 <arg value="--unlink"/>
1022 </exec>
1023 <exec append="false" executable="wget" failifexecutionfails="true">
1024 <arg value="https://raw.githubusercontent.com/osmlab/editor-layer-index/gh-pages/imagery.geojson"/>
1025 <arg value="-O"/>
1026 <arg value="imagery_eli.geojson"/>
1027 <arg value="--unlink"/>
1028 </exec>
1029 <exec append="false" executable="wget" failifexecutionfails="true">
1030 <arg value="https://raw.githubusercontent.com/openstreetmap/iD/develop/data/imagery.json"/>
1031 <arg value="-O"/>
1032 <arg value="imagery_id.geojson"/>
1033 <arg value="--unlink"/>
1034 </exec>
1035 <exec append="false" executable="wget" failifexecutionfails="true">
1036 <arg value="https://raw.githubusercontent.com/facebook/Rapid/main/data/imagery.json"/>
1037 <arg value="-O"/>
1038 <arg value="imagery_rapid.geojson"/>
1039 <arg value="--unlink"/>
1040 </exec>
1041 <antcall target="imageryindex"/>
1042 </target>
1043
1044 <target name="checkstyle-changed" depends="init" description="Run Checkstyle on SVN/Git-changed source files">
1045 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="checkstyle.classpath" conf="checkstyle"/>
1046 <exec append="false" osfamily="unix" executable="bash" failifexecutionfails="true">
1047 <arg value="-c"/>
1048 <arg value="(git ls-files src test --modified 2>/dev/null || svn status -q --ignore-externals src test) | grep -o '\(src\|test\)/.*' | xargs java -cp '${toString:checkstyle.classpath}' com.puppycrawl.tools.checkstyle.Main -c ${checkstyle.dir}/josm_checks.xml | sed -e 's:\([^ ]*\) [^:]*/\([^:/]*.java\:[^:]*\):(\2)\1:'"/>
1049 </exec>
1050 <exec append="false" osfamily="windows" executable="powershell" failifexecutionfails="true">
1051 <arg value="/c"/>
1052 <arg value="svn status -q --ignore-externals src test | ForEach-Object {java -cp '${toString:checkstyle.classpath}' com.puppycrawl.tools.checkstyle.Main -c ${checkstyle.dir}/josm_checks.xml $_.split(' ')[7]}"/>
1053 </exec>
1054 </target>
1055 <target name="checkstyle" depends="init" description="Run Checkstyle on the source files">
1056 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="checkstyle.classpath" conf="checkstyle"/>
1057 <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties">
1058 <classpath refid="checkstyle.classpath"/>
1059 </taskdef>
1060 <checkstyle config="${checkstyle.dir}/josm_checks.xml">
1061 <fileset dir="${base.dir}/src/org/openstreetmap/josm" includes="**/*.java"
1062 excludes="gui/mappaint/mapcss/parsergen/*.java"/>
1063 <fileset dir="${base.dir}/test" includes="**/*.java"/>
1064 <fileset dir="${base.dir}/scripts" includes="**/*.java"/>
1065 <formatter type="plain"/>
1066 <formatter type="xml" toFile="checkstyle-josm.xml"/>
1067 </checkstyle>
1068 </target>
1069
1070 <target name="spotbugs" depends="dist" description="Run SpotBugs on the source files">
1071 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="spotbugs.classpath" conf="spotbugs"/>
1072 <taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="spotbugs.classpath"/>
1073 <spotbugs output="xml"
1074 outputFile="spotbugs-josm.xml"
1075 sourcePath="${src.dir}"
1076 classpath="${toString:spotbugs.classpath}"
1077 pluginList=""
1078 excludeFilter="${spotbugs.dir}/josm-filter.xml"
1079 onlyAnalyze="org.openstreetmap.josm.-"
1080 effort="max"
1081 reportLevel="low"
1082 >
1083 <class location="${dist.jar}" />
1084 </spotbugs>
1085 </target>
1086
1087 <target name="pmd" depends="init" description="Run PMD on the source files">
1088 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="pmd.classpath" conf="pmd"/>
1089 <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath"/>
1090 <pmd cacheLocation="${pmd.dir}/cache" encoding="UTF-8">
1091 <sourceLanguage name="java" version="${java.lang.version}" />
1092 <ruleset>${pmd.dir}/josm-ruleset.xml</ruleset>
1093 <formatter type="text" toConsole="true" />
1094 <formatter type="xml" toFile="pmd-josm.xml">
1095 <param name="encoding" value="UTF-8" />
1096 </formatter>
1097 <fileset dir="${src.dir}">
1098 <include name="org/openstreetmap/josm/**/*.java"/>
1099 <exclude name="org/openstreetmap/josm/gui/mappaint/mapcss/parsergen/*.java" />
1100 </fileset>
1101 <fileset dir="${base.dir}/scripts" includes="**/*.java"/>
1102 <relativizePathsWith><path path="${base.dir}"/></relativizePathsWith>
1103 </pmd>
1104 </target>
1105
1106 <target name="run" depends="dist" description="Run JOSM">
1107 <java jar="${dist.jar}" fork="true">
1108 <arg value="--set=expert=true"/>
1109 <arg value="--set=iso.dates=true"/>
1110 <jvmarg value="-Djosm.home=/tmp/.josm/"/>
1111 </java>
1112 </target>
1113 <target name="epsg-compile" depends="init"
1114 description="Compile build script for generating projection list">
1115 <property name="proj-classpath" location="${build.dir}"/>
1116 <mkdir dir="${proj-build.dir}"/>
1117 <javac sourcepath="" srcdir="${base.dir}/scripts" failonerror="true" includes="BuildProjectionDefinitions.java"
1118 destdir="${proj-build.dir}" release="${java.lang.version}" debug="on"
1119 includeantruntime="false"
1120 encoding="UTF-8" classpath="${proj-classpath}">
1121 </javac>
1122 </target>
1123 <target name="epsg" unless="epsg.notRequired" depends="epsg-compile"
1124 description="Generate projection list">
1125 <touch file="${epsg.output}" mkdirs="true"/>
1126 <java classname="BuildProjectionDefinitions" failonerror="true" fork="true">
1127 <sysproperty key="java.awt.headless" value="true"/>
1128 <classpath>
1129 <pathelement path="${resources.dir}"/>
1130 <pathelement path="${proj-classpath}"/>
1131 <pathelement path="${proj-build.dir}"/>
•1132 <path refid="classpath"/>
1133 </classpath>
1134 <arg value="${base.dir}"/>
1135 </java>
1136 </target>
1137 <target name="update-proj-files" depends="test-compile"
1138 description="Update projection test files after an update of projection definitions">
1139 <java classname="org.openstreetmap.josm.data.projection.ProjectionRefTest" failonerror="true" fork="true">
1140 <classpath>
1141 <path refid="test.classpath"/>
1142 <pathelement path="${test.dir}/build/unit"/>
1143 </classpath>
1144 </java>
1145 <java classname="org.openstreetmap.josm.data.projection.ProjectionRegressionTest" failonerror="true" fork="true">
1146 <classpath>
1147 <path refid="test.classpath"/>
1148 <pathelement path="${test.dir}/build/unit"/>
1149 </classpath>
1150 </java>
1151 </target>
1152 <target name="jdeps" depends="compile" description="Generate jdeps dependency graph">
1153 <delete dir="${modules.dir}"/>
1154 <mkdir dir="${modules.dir}"/>
1155 <!-- JOSM only -->
1156 <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-actions.jar" includes="org/openstreetmap/josm/actions/**/*.class"/>
1157 <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-cli.jar" includes="org/openstreetmap/josm/cli/**/*.class"/>
1158 <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-command.jar" includes="org/openstreetmap/josm/command/**/*.class"/>
1159 <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-data.jar" includes="org/openstreetmap/josm/data/**/*.class"/>
1160 <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-gui.jar" includes="org/openstreetmap/josm/gui/**/*.class"/>
1161 <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-io.jar" includes="org/openstreetmap/josm/io/**/*.class"/>
1162 <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-plugins.jar" includes="org/openstreetmap/josm/plugins/**/*.class"/>
1163 <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-spi.jar" includes="org/openstreetmap/josm/spi/**/*.class"/>
1164 <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-tools.jar" includes="org/openstreetmap/josm/tools/**/*.class"/>
1165 <path id="jar.files">
1166 <fileset dir="${modules.dir}" includes="*.jar"/>
1167 </path>
1168 <pathconvert property="jar.files.string" refid="jar.files" pathsep=" "/>
1169 <exec executable="jdeps" dir="${modules.dir}">
1170 <arg line="-f 'java.*|org.xml.*|org.w3c.*|sun.*|com.*|oauth.*|org.apache.*|org.glassfish.*|org.openstreetmap.gui.*'"/>
1171 <arg line="-dotoutput dots" />
1172 <arg line="${jar.files.string}" />
1173 </exec>
1174 <exec executable="dot" dir="${modules.dir}/dots">
1175 <arg line="-O -Tpng summary.dot"/>
1176 </exec>
1177 <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-without-dependencies.png"/>
1178
1179 <!-- Direct dependencies -->
1180 <copy todir="${modules.dir}" flatten="true">
1181 <fileset refid="runtime.fileset" />
1182 </copy>
1183 <path id="jar-direct.files">
1184 <fileset dir="${modules.dir}" includes="*.jar"/>
1185 </path>
1186 <pathconvert property="jar-direct.files.string" refid="jar-direct.files" pathsep=" "/>
1187 <exec executable="jdeps" dir="${modules.dir}">
1188 <arg line="-f 'java.*|org.xml.*|org.w3c.*|sun.*|com.sun.*|com.google.*|org.tukaani.*'"/>
1189 <arg line="-dotoutput dots"/>
1190 <arg line="--multi-release 11"/>
1191 <arg line="${jar-direct.files.string}" />
1192 </exec>
1193 <exec executable="dot" dir="${modules.dir}/dots">
1194 <arg line="-O -Tpng summary.dot"/>
1195 </exec>
1196 <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-with-direct-dependencies.png"/>
1197 <!-- All dependencies -->
1198 <jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/google-gdata.jar" includes="com/google/**/*.class"/>
1199 <path id="jar-all.files">
1200 <fileset dir="${modules.dir}" includes="*.jar"/>
1201 </path>
1202 <pathconvert property="jar-all.files.string" refid="jar-direct.files" pathsep=" "/>
1203 <exec executable="jdeps" dir="${modules.dir}">
1204 <arg line="-dotoutput dots"/>
1205 <arg line="--multi-release 11"/>
1206 <arg line="${jar-all.files.string}" />
1207 </exec>
1208 <exec executable="dot" dir="${modules.dir}/dots">
1209 <arg line="-O -Tpng summary.dot"/>
1210 </exec>
1211 <move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-with-all-dependencies.png"/>
1212 </target>
1213 <target name="resolve" depends="init-ivy" unless="resolve.notRequired" description="Resolve Ivy dependencies">
•1214 <!--
1215 <ivy:settings file="${base.dir}/ivysettings.xml"/>
1216 <ivy:resolve log="download-only" file="${base.dir}/ivy.xml" keep="true"/>
1217 <ivy:cachepath log="download-only" pathid="compile.path" conf="compile"/>
1218 <ivy:cachepath log="download-only" pathid="runtime.path" conf="runtime"/>
1219 <ivy:cachefileset log="download-only" setid="runtime.fileset" conf="runtime"/>
1220 <ivy:cachepath log="download-only" pathid="test.path" conf="test"/>
•1221 -->
1222 </target>
1223 <target name="extract-libraries" depends="resolve" description="Extract libraries to build dir">
1224 <unzip dest="${build.dir}">
1225 <fileset refid="runtime.fileset"/>
1226 <patternset>
1227 <exclude name="META-INF/*"/>
1228 <exclude name="META-INF/maven/**"/>
1229 <exclude name="META-INF/resources/webjars/tag2link/*/LICENSE"/>
1230 <exclude name="META-INF/resources/webjars/tag2link/*/README.md"/>
1231 <exclude name="META-INF/resources/webjars/tag2link/*/build.js"/>
1232 <exclude name="META-INF/resources/webjars/tag2link/*/package.json"/>
1233 <exclude name="META-INF/resources/webjars/tag2link/*/schema.json"/>
1234 <exclude name="META-INF/resources/webjars/tag2link/*/tag2link.sophox.sparql"/>
1235 <exclude name="META-INF/resources/webjars/tag2link/*/tag2link.wikidata.sparql"/>
1236 <exclude name="META-INF/versions/**"/>
1237 <exclude name="*"/>
1238 <exclude name="org/openstreetmap/gui/jmapviewer/Demo*"/>
1239 <exclude name="com/drew/imaging/FileTypeDetector*"/>
1240 <exclude name="com/drew/imaging/ImageMetadataReader*"/>
1241 <exclude name="com/drew/imaging/avi/**"/>
1242 <exclude name="com/drew/imaging/bmp/**"/>
1243 <exclude name="com/drew/imaging/eps/**"/>
1244 <exclude name="com/drew/imaging/gif/**"/>
1245 <exclude name="com/drew/imaging/heif/**"/>
1246 <exclude name="com/drew/imaging/ico/**"/>
1247 <exclude name="com/drew/imaging/mp3/**"/>
1248 <exclude name="com/drew/imaging/mp4/**"/>
1249 <exclude name="com/drew/imaging/pcx/**"/>
1250 <exclude name="com/drew/imaging/psd/**"/>
1251 <exclude name="com/drew/imaging/quicktime/**"/>
1252 <exclude name="com/drew/imaging/raf/**"/>
1253 <exclude name="com/drew/imaging/riff/**"/>
1254 <exclude name="com/drew/imaging/wav/**"/>
1255 <exclude name="com/drew/imaging/webp/**"/>
1256 <exclude name="com/drew/metadata/avi/**"/>
1257 <exclude name="com/drew/metadata/bmp/**"/>
1258 <exclude name="com/drew/metadata/eps/**"/>
1259 <exclude name="com/drew/metadata/gif/**"/>
1260 <exclude name="com/drew/metadata/heif/**"/>
1261 <exclude name="com/drew/metadata/ico/**"/>
1262 <exclude name="com/drew/metadata/mov/**"/>
1263 <exclude name="com/drew/metadata/mp3/**"/>
1264 <exclude name="com/drew/metadata/mp4/**"/>
1265 <exclude name="com/drew/metadata/pcx/**"/>
1266 <exclude name="com/drew/metadata/wav/**"/>
1267 <exclude name="com/drew/metadata/webp/**"/>
1268 <exclude name="com/drew/tools/**"/>
1269 <exclude name="org/apache/commons/compress/PasswordRequiredException*"/>
1270 <exclude name="org/apache/commons/compress/archivers/**"/>
1271 <exclude name="org/apache/commons/compress/changes/**"/>
1272 <exclude name="org/apache/commons/compress/compressors/bzip2/BZip2Utils*"/>
1273 <exclude name="org/apache/commons/compress/compressors/brotli/**"/>
1274 <exclude name="org/apache/commons/compress/compressors/CompressorStreamFactory*"/>
1275 <exclude name="org/apache/commons/compress/compressors/CompressorStreamProvider*"/>
1276 <exclude name="org/apache/commons/compress/compressors/CompressorException*"/>
1277 <exclude name="org/apache/commons/compress/compressors/FileNameUtil*"/>
1278 <exclude name="org/apache/commons/compress/compressors/deflate/**"/>
1279 <exclude name="org/apache/commons/compress/compressors/gzip/**"/>
1280 <exclude name="org/apache/commons/compress/compressors/lz4/**"/>
1281 <exclude name="org/apache/commons/compress/compressors/lzma/**"/>
1282 <exclude name="org/apache/commons/compress/compressors/lz77support/**"/>
1283 <exclude name="org/apache/commons/compress/compressors/pack200/**"/>
1284 <exclude name="org/apache/commons/compress/compressors/snappy/**"/>
1285 <exclude name="org/apache/commons/compress/compressors/xz/XZUtils*"/>
1286 <exclude name="org/apache/commons/compress/compressors/z/**"/>
1287 <exclude name="org/apache/commons/compress/compressors/zstandard/**"/>
1288 <exclude name="org/apache/commons/compress/java/util/jar/Pack200*"/>
1289 <exclude name="org/apache/commons/compress/harmony/pack200/**"/>
1290 <exclude name="org/apache/commons/compress/harmony/unpack200/**"/>
1291 <exclude name="org/apache/commons/compress/parallel/**"/>
1292 <exclude name="org/apache/commons/compress/utils/ArchiveUtils*"/>
1293 <exclude name="org/apache/commons/jcs3/auxiliary/disk/jdbc/**"/>
1294 <exclude name="org/apache/commons/jcs3/auxiliary/remote/http/client/**"/>
1295 <exclude name="org/apache/commons/jcs3/auxiliary/remote/http/server/RemoteHttpCacheServlet*"/>
1296 <exclude name="org/apache/commons/jcs3/auxiliary/remote/server/RemoteCacheStartupServlet*"/>
1297 <exclude name="org/apache/commons/jcs3/log/Log4j2Factory*"/>
1298 <exclude name="org/apache/commons/jcs3/log/Log4j2LogAdapter*"/>
1299 <exclude name="org/apache/commons/jcs3/utils/servlet/**"/>
1300 </patternset>
1301 </unzip>
1302 </target>
1303 <target name="sources" description="Generate jar file of JOSM source files and its dependencies" depends="init,epsg,resolve">
1304 <ivy:cachefileset log="download-only" setid="sources.fileset" conf="sources"/>
1305 <jar destfile="${dist-sources.jar}" level="${clevel}">
1306 <zipgroupfileset refid="sources.fileset"/>
1307 <fileset dir="${src.dir}"/>
1308 <fileset dir="${resources.dir}"/>
1309 </jar>
1310 </target>
1311 <target name="bootstrap-workspace" description="Copy libraries from ivy cache to workspace folders for IDE" depends="resolve">
1312 <delete dir="${lib.dir}"/>
1313 <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[type].[ext]" conf="compile,runtime,sources,test"/>
1314 <ivy:retrieve pattern="${lib.dir}/tools/[artifact]-[type].[ext]" conf="javacc,checkstyle,pmd,spotbugs,errorprone" file="${tools.ivy}"/>
1315 </target>
1316 <target name="ivy-report" description="Generate Ivy reports of dependency resolving" depends="resolve">
1317 <ivy:report todir="${tools.dir}/ivy-report" graph="false"/>
1318 </target>
1319 <target name="ivy-checkdepsupdate" description="Display dependency updates on the console" depends="resolve">
1320 <ivy:resolve log="quiet" file="${tools.ivy}" keep="true" conf="*"/>
1321 <ivy:checkdepsupdate/>
1322 <echo message="${line.separator}"/>
1323 <ivy:resolve log="quiet" file="${base.dir}/ivy.xml" keep="true" conf="*"/>
1324 <ivy:checkdepsupdate/>
1325 </target>
1326 <target name="api-dependency-tree" description="Displays Ivy dependency tree for JOSM API" depends="resolve">
1327 <ivy:dependencytree conf="api"/>
1328 </target>
1329 <target name="test-dependency-tree" description="Displays Ivy dependency tree for JOSM tests" depends="resolve">
1330 <ivy:dependencytree conf="test"/>
1331 </target>
1332 </project>