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