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 xmlns:as="antlib:org.codehaus.mojo.animal_sniffer" name="josm" default="dist" xmlns:jacoco="antlib:org.jacoco.ant" xmlns:if="ant:if">
|
---|
12 | <target name="init-properties">
|
---|
13 | <!-- Load properties in a target and not at top level, so this build file can be
|
---|
14 | imported from an IDE ant file (Netbeans) without messing up IDE properties.
|
---|
15 | When imported from another file, ${basedir} will point to the parent directory
|
---|
16 | of the importing ant file. Use ${base.dir} instead, which is always the parent
|
---|
17 | directory of this file. -->
|
---|
18 | <dirname property="base.dir" file="${ant.file.josm}"/>
|
---|
19 | <property name="test.dir" location="${base.dir}/test"/>
|
---|
20 | <property name="src.dir" location="${base.dir}/src"/>
|
---|
21 | <property name="build.dir" location="${base.dir}/build"/>
|
---|
22 | <property name="dist.dir" location="${base.dir}/dist"/>
|
---|
23 | <property name="tools.dir" location="${base.dir}/tools"/>
|
---|
24 | <property name="pmd.dir" location="${tools.dir}/pmd"/>
|
---|
25 | <property name="checkstyle.dir" location="${tools.dir}/checkstyle"/>
|
---|
26 | <property name="spotbugs.dir" location="${tools.dir}/spotbugs"/>
|
---|
27 | <property name="javacc.home" location="${tools.dir}"/>
|
---|
28 | <property name="mapcss.dir" location="${src.dir}/org/openstreetmap/josm/gui/mappaint/mapcss"/>
|
---|
29 | <property name="proj-build.dir" location="${base.dir}/build2"/>
|
---|
30 | <property name="checkstyle-build.dir" location="${base.dir}/build2"/>
|
---|
31 | <property name="epsg.output" location="${base.dir}/data/projection/custom-epsg"/>
|
---|
32 | <property name="groovy.jar" location="${tools.dir}/groovy-all.jar"/>
|
---|
33 | <property name="error_prone_ant.jar" location="${tools.dir}/error_prone_ant.jar"/>
|
---|
34 | <property name="dist.jar" location="${dist.dir}/josm-custom.jar"/>
|
---|
35 | <property name="dist-optimized.jar" location="${dist.dir}/josm-custom-optimized.jar"/>
|
---|
36 | <property name="javac.compiler" value="com.google.errorprone.ErrorProneAntCompilerAdapter" />
|
---|
37 | <property name="java.lang.version" value="1.8" />
|
---|
38 | <property name="jacoco.includes" value="org.openstreetmap.josm.*" />
|
---|
39 | <property name="jacoco.inclbootstrapclasses" value="false" />
|
---|
40 | <property name="jacoco.inclnolocationclasses" value="false" />
|
---|
41 | <!-- build parameter: compression level (ant -Dclevel=N)
|
---|
42 | N ranges from 0 (no compression) to 9 (maximum compression)
|
---|
43 | default: 9 -->
|
---|
44 | <condition property="clevel" value="${clevel}" else="9">
|
---|
45 | <isset property="clevel"/>
|
---|
46 | </condition>
|
---|
47 | <!-- For Java9-specific stuff -->
|
---|
48 | <condition property="isJava9">
|
---|
49 | <matches string="${ant.java.version}" pattern="(1.)?(9|1[0-9])" />
|
---|
50 | </condition>
|
---|
51 | <path id="test.classpath">
|
---|
52 | <fileset dir="${test.dir}/lib">
|
---|
53 | <include name="**/*.jar"/>
|
---|
54 | </fileset>
|
---|
55 | <pathelement path="${dist.jar}"/>
|
---|
56 | <pathelement path="${groovy.jar}"/>
|
---|
57 | <pathelement path="${spotbugs.dir}/spotbugs-annotations.jar"/>
|
---|
58 | </path>
|
---|
59 | <path id="pmd.classpath">
|
---|
60 | <fileset dir="${pmd.dir}">
|
---|
61 | <include name="*.jar"/>
|
---|
62 | </fileset>
|
---|
63 | </path>
|
---|
64 | </target>
|
---|
65 |
|
---|
66 | <!--
|
---|
67 | ** Used by Eclipse ant builder for updating
|
---|
68 | ** the REVISION file used by JOSM
|
---|
69 | -->
|
---|
70 | <target name="create-revision-eclipse">
|
---|
71 | <property name="revision.dir" value="bin"/>
|
---|
72 | <antcall target="create-revision"/>
|
---|
73 | <mkdir dir="bin/META-INF/services"/>
|
---|
74 | <echo encoding="UTF-8" file="bin/META-INF/services/java.text.spi.DecimalFormatSymbolsProvider">org.openstreetmap.josm.tools.JosmDecimalFormatSymbolsProvider</echo>
|
---|
75 | </target>
|
---|
76 | <!--
|
---|
77 | ** Initializes the REVISION.XML file from SVN information
|
---|
78 | -->
|
---|
79 | <target name="init-svn-revision-xml" depends="init-properties">
|
---|
80 | <exec append="false" output="${base.dir}/REVISION.XML" executable="svn" dir="${base.dir}" failifexecutionfails="false" resultproperty="svn.info.result">
|
---|
81 | <env key="LANG" value="C"/>
|
---|
82 | <arg value="info"/>
|
---|
83 | <arg value="--xml"/>
|
---|
84 | <arg value="."/>
|
---|
85 | </exec>
|
---|
86 | <condition property="svn.info.success">
|
---|
87 | <equals arg1="${svn.info.result}" arg2="0" />
|
---|
88 | </condition>
|
---|
89 | </target>
|
---|
90 | <!--
|
---|
91 | ** Initializes the REVISION.XML file from git information
|
---|
92 | -->
|
---|
93 | <target name="init-git-revision-xml" unless="svn.info.success" depends="init-properties">
|
---|
94 | <exec append="false" output="${base.dir}/REVISION.XML" executable="git" dir="${base.dir}" failifexecutionfails="false">
|
---|
95 | <arg value="log"/>
|
---|
96 | <arg value="-1"/>
|
---|
97 | <arg value="--grep=git-svn-id"/>
|
---|
98 | <!--
|
---|
99 | %B: raw body (unwrapped subject and body)
|
---|
100 | %n: new line
|
---|
101 | %ai: author date, ISO 8601 format
|
---|
102 | -->
|
---|
103 | <arg value="--pretty=format:%B%n%ai"/>
|
---|
104 | <arg value="HEAD"/>
|
---|
105 | </exec>
|
---|
106 | <replaceregexp file="${base.dir}/REVISION.XML" flags="s"
|
---|
107 | match=".*git-svn-id: [^@]*@([0-9]+).*(\d{4}-\d{2}-\d{2}.\d{2}\:\d{2}\:\d{2}\s*[+-]\d{2}:?\d{2})\s*$"
|
---|
108 | replace="<info><entry><commit revision="\1"><date>\2</date></commit></entry></info>"/>
|
---|
109 | </target>
|
---|
110 | <!--
|
---|
111 | ** Creates the REVISION file to be included in the distribution
|
---|
112 | -->
|
---|
113 | <target name="create-revision" depends="init-properties,init-svn-revision-xml,init-git-revision-xml">
|
---|
114 | <property name="revision.dir" value="${build.dir}"/>
|
---|
115 | <xmlproperty file="${base.dir}/REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
116 | <delete file="${base.dir}/REVISION.XML"/>
|
---|
117 | <tstamp>
|
---|
118 | <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss"/>
|
---|
119 | </tstamp>
|
---|
120 | <property name="version.entry.commit.revision" value="UNKNOWN"/>
|
---|
121 | <property name="version.entry.commit.date" value="UNKNOWN"/>
|
---|
122 | <mkdir dir="${revision.dir}"/>
|
---|
123 | <!-- add Build-Name: ... when making special builds, e.g. DEBIAN -->
|
---|
124 | <echo file="${revision.dir}/REVISION">
|
---|
125 | # automatically generated by JOSM build.xml - do not edit
|
---|
126 | Revision: ${version.entry.commit.revision}
|
---|
127 | Is-Local-Build: true
|
---|
128 | Build-Date: ${build.tstamp}
|
---|
129 | </echo>
|
---|
130 | </target>
|
---|
131 | <!--
|
---|
132 | ** Check internal XML files against their XSD
|
---|
133 | -->
|
---|
134 | <target name="check-schemas" unless="check-schemas.notRequired" depends="init-properties">
|
---|
135 | <schemavalidate file="data/defaultpresets.xml" >
|
---|
136 | <schema namespace="http://josm.openstreetmap.de/tagging-preset-1.0" file="data/tagging-preset.xsd" />
|
---|
137 | </schemavalidate>
|
---|
138 | </target>
|
---|
139 | <!--
|
---|
140 | ** Main target that builds JOSM and checks XML against schemas
|
---|
141 | -->
|
---|
142 | <target name="dist" depends="compile,create-revision,check-schemas,epsg">
|
---|
143 | <echo>Revision ${version.entry.commit.revision}</echo>
|
---|
144 | <copy file="CONTRIBUTION" todir="${build.dir}"/>
|
---|
145 | <copy file="README" todir="${build.dir}"/>
|
---|
146 | <copy file="LICENSE" todir="${build.dir}"/>
|
---|
147 | <!-- create josm-custom.jar -->
|
---|
148 | <delete file="${dist.jar}"/>
|
---|
149 | <jar destfile="${dist.jar}" basedir="${build.dir}" level="${clevel}">
|
---|
150 | <!-- add attribute excludes="**/*BZip2*,**/*Bzip2*" to create a non-bzip2 supporting jar -->
|
---|
151 | <manifest>
|
---|
152 | <attribute name="Main-class" value="org.openstreetmap.josm.gui.MainApplication"/>
|
---|
153 | <attribute name="Main-Version" value="${version.entry.commit.revision} SVN"/>
|
---|
154 | <attribute name="Main-Date" value="${version.entry.commit.date}"/>
|
---|
155 | <attribute name="Permissions" value="all-permissions"/>
|
---|
156 | <attribute name="Codebase" value="josm.openstreetmap.de"/>
|
---|
157 | <attribute name="Application-Name" value="JOSM - Java OpenStreetMap Editor"/>
|
---|
158 | <!-- Java 9 stuff. Entries are safely ignored by Java 8 -->
|
---|
159 | <attribute name="Add-Exports" value="java.base/sun.security.util java.base/sun.security.x509 java.desktop/com.apple.eawt java.desktop/com.sun.imageio.spi javafx.graphics/com.sun.javafx.application jdk.deploy/com.sun.deploy.config" />
|
---|
160 | <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" />
|
---|
161 | </manifest>
|
---|
162 | <service type="java.text.spi.DecimalFormatSymbolsProvider" provider="org.openstreetmap.josm.tools.JosmDecimalFormatSymbolsProvider" />
|
---|
163 | <zipfileset dir="images" prefix="images"/>
|
---|
164 | <zipfileset dir="data" prefix="data"/>
|
---|
165 | <zipfileset dir="styles" prefix="styles"/>
|
---|
166 | <zipfileset dir="${src.dir}/org/openstreetmap/gui/jmapviewer/images" prefix="org/openstreetmap/gui/jmapviewer/images"/>
|
---|
167 | </jar>
|
---|
168 | </target>
|
---|
169 | <!-- Mac OS X target -->
|
---|
170 | <target name="mac" depends="init-properties">
|
---|
171 | <!-- Using https://bitbucket.org/infinitekind/appbundler to create mac application bundle -->
|
---|
172 | <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="${tools.dir}/appbundler-1.0ea.jar"/>
|
---|
173 | <!-- create MacOS X application bundle -->
|
---|
174 | <bundleapp outputdirectory="${bundle.outdir}" name="JOSM" displayname="JOSM" executablename="JOSM" identifier="org.openstreetmap.josm"
|
---|
175 | mainclassname="org.openstreetmap.josm.gui.MainApplication"
|
---|
176 | copyright="JOSM, and all its integral parts, are released under the GNU General Public License v2 or later"
|
---|
177 | applicationCategory="public.app-category.utilities"
|
---|
178 | shortversion="${version.entry.commit.revision} SVN"
|
---|
179 | version="${version.entry.commit.revision} SVN"
|
---|
180 | icon="macosx/JOSM.app/Contents/Resources/JOSM.icns"
|
---|
181 | highResolutionCapable="true">
|
---|
182 |
|
---|
183 | <arch name="x86_64"/>
|
---|
184 | <arch name="i386"/>
|
---|
185 |
|
---|
186 | <classpath file="${bundle.jar}"/>
|
---|
187 |
|
---|
188 | <option value="-Xmx1024m"/>
|
---|
189 |
|
---|
190 | <option value="-Xdock:icon=Contents/Resources/JOSM.icns"/>
|
---|
191 | <option value="-Xdock:name=JOSM"/>
|
---|
192 |
|
---|
193 | <!-- OSX specific options, optional -->
|
---|
194 | <option value="-Dapple.laf.useScreenMenuBar=true"/>
|
---|
195 | <option value="-Dcom.apple.macos.use-file-dialog-packages=true"/>
|
---|
196 | <option value="-Dcom.apple.macos.useScreenMenuBar=true"/>
|
---|
197 | <option value="-Dcom.apple.mrj.application.apple.menu.about.name=JOSM"/>
|
---|
198 | <option value="-Dcom.apple.smallTabs=true"/>
|
---|
199 | </bundleapp>
|
---|
200 |
|
---|
201 | <!-- appbundler lacks the possibility of defining our own keys or using a template, so update the .plist manually -->
|
---|
202 | <taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" classpath="${tools.dir}/xmltask.jar"/>
|
---|
203 |
|
---|
204 | <xmltask source="${bundle.outdir}/JOSM.app/Contents/Info.plist" dest="${bundle.outdir}/JOSM.app/Contents/Info.plist" indent="false">
|
---|
205 | <!-- remove empty CFBundleDocumentTypes definition -->
|
---|
206 | <remove path="/plist/dict/key[text()='CFBundleDocumentTypes']|/plist/dict/key[text()='CFBundleDocumentTypes']/following-sibling::array[1]"/>
|
---|
207 | <!-- insert our own keys -->
|
---|
208 | <insert position="before" path="/plist/dict/key[1]" file="macosx/JOSM.app/Contents/Info.plist_template.xml" />
|
---|
209 | </xmltask>
|
---|
210 |
|
---|
211 | <!-- create ZIP file with MacOS X application bundle -->
|
---|
212 | <zip destfile="${bundle.outdir}/josm-custom-macosx.zip" update="true">
|
---|
213 | <zipfileset dir="." includes="CONTRIBUTION README LICENSE"/>
|
---|
214 | <zipfileset dir="${bundle.outdir}" includes="JOSM.app/**/*" filemode="755" />
|
---|
215 | </zip>
|
---|
216 | </target>
|
---|
217 | <target name="distmac" depends="dist">
|
---|
218 | <antcall target="mac">
|
---|
219 | <param name="bundle.outdir" value="${dist.dir}"/>
|
---|
220 | <param name="bundle.jar" value="${dist.jar}"/>
|
---|
221 | </antcall>
|
---|
222 | </target>
|
---|
223 | <!-- Windows target -->
|
---|
224 | <target name="distwin" depends="dist">
|
---|
225 | <exec dir="windows" executable="./josm-setup-unix.sh">
|
---|
226 | <arg value="${version.entry.commit.revision}"/>
|
---|
227 | <arg value="${dist.jar}"/>
|
---|
228 | </exec>
|
---|
229 | </target>
|
---|
230 | <target name="javacc" depends="init" unless="javacc.notRequired">
|
---|
231 | <mkdir dir="${mapcss.dir}/parsergen"/>
|
---|
232 | <java classname="javacc" fork="true" failonerror="true">
|
---|
233 | <classpath path="${javacc.home}/javacc.jar"/>
|
---|
234 | <arg value="-DEBUG_PARSER=false"/>
|
---|
235 | <arg value="-DEBUG_TOKEN_MANAGER=false"/>
|
---|
236 | <arg value="-JDK_VERSION=${java.lang.version}"/>
|
---|
237 | <arg value="-GRAMMAR_ENCODING=UTF-8"/>
|
---|
238 | <arg value="-OUTPUT_DIRECTORY=${mapcss.dir}/parsergen"/>
|
---|
239 | <arg value="${mapcss.dir}/MapCSSParser.jj"/>
|
---|
240 | </java>
|
---|
241 | </target>
|
---|
242 | <target name="compile-cots" depends="init">
|
---|
243 | <!-- COTS -->
|
---|
244 | <javac srcdir="${src.dir}" includes="com/**,javax/**,oauth/**,org/apache/commons/**,org/glassfish/**,gnu/**" nowarn="on" encoding="iso-8859-1"
|
---|
245 | destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeAntRuntime="false" createMissingPackageInfoClass="false">
|
---|
246 | <!-- get rid of "internal proprietary API" warning -->
|
---|
247 | <compilerarg value="-XDignore.symbol.file"/>
|
---|
248 | <exclude name="org/apache/commons/compress/PasswordRequiredException.java"/>
|
---|
249 | <exclude name="org/apache/commons/compress/archivers/**"/>
|
---|
250 | <exclude name="org/apache/commons/compress/changes/**"/>
|
---|
251 | <exclude name="org/apache/commons/compress/compressors/bzip2/BZip2Utils.java"/>
|
---|
252 | <exclude name="org/apache/commons/compress/compressors/brotli/**"/>
|
---|
253 | <exclude name="org/apache/commons/compress/compressors/lzma/**"/>
|
---|
254 | <exclude name="org/apache/commons/compress/compressors/xz/**"/>
|
---|
255 | <exclude name="org/apache/commons/compress/compressors/CompressorStreamFactory.java"/>
|
---|
256 | <exclude name="org/apache/commons/compress/compressors/CompressorStreamProvider.java"/>
|
---|
257 | <exclude name="org/apache/commons/compress/compressors/CompressorException.java"/>
|
---|
258 | <exclude name="org/apache/commons/compress/compressors/FileNameUtil.java"/>
|
---|
259 | <exclude name="org/apache/commons/compress/compressors/deflate/**"/>
|
---|
260 | <exclude name="org/apache/commons/compress/compressors/gzip/**"/>
|
---|
261 | <exclude name="org/apache/commons/compress/compressors/lz4/**"/>
|
---|
262 | <exclude name="org/apache/commons/compress/compressors/lz77support/**"/>
|
---|
263 | <exclude name="org/apache/commons/compress/compressors/pack200/**"/>
|
---|
264 | <exclude name="org/apache/commons/compress/compressors/snappy/**"/>
|
---|
265 | <exclude name="org/apache/commons/compress/compressors/z/**"/>
|
---|
266 | <exclude name="org/apache/commons/compress/compressors/zstandard/**"/>
|
---|
267 | <exclude name="org/apache/commons/compress/parallel/**"/>
|
---|
268 | <exclude name="org/apache/commons/compress/utils/ArchiveUtils.java"/>
|
---|
269 | <exclude name="org/apache/commons/jcs/JCS.java"/>
|
---|
270 | <exclude name="org/apache/commons/jcs/access/GroupCacheAccess.java"/>
|
---|
271 | <exclude name="org/apache/commons/jcs/access/PartitionedCacheAccess.java"/>
|
---|
272 | <exclude name="org/apache/commons/jcs/access/behavior/IGroupCacheAccess.java"/>
|
---|
273 | <exclude name="org/apache/commons/jcs/access/exception/InvalidGroupException.java"/>
|
---|
274 | <exclude name="org/apache/commons/jcs/admin/servlet/**"/>
|
---|
275 | <exclude name="org/apache/commons/jcs/auxiliary/AbstractAuxiliaryCacheMonitor.java"/>
|
---|
276 | <exclude name="org/apache/commons/jcs/auxiliary/disk/jdbc/**"/>
|
---|
277 | <exclude name="org/apache/commons/jcs/auxiliary/lateral/**"/>
|
---|
278 | <exclude name="org/apache/commons/jcs/auxiliary/remote/**"/>
|
---|
279 | <exclude name="org/apache/commons/jcs/engine/CacheAdaptor.java"/>
|
---|
280 | <exclude name="org/apache/commons/jcs/engine/CacheGroup.java"/>
|
---|
281 | <exclude name="org/apache/commons/jcs/engine/CacheWatchRepairable.java"/>
|
---|
282 | <exclude name="org/apache/commons/jcs/engine/Zombie*.java"/>
|
---|
283 | <exclude name="org/apache/commons/jcs/engine/logging/CacheEventLoggerDebugLogger.java"/>
|
---|
284 | <exclude name="org/apache/commons/jcs/utils/access/**"/>
|
---|
285 | <exclude name="org/apache/commons/jcs/utils/discovery/**"/>
|
---|
286 | <exclude name="org/apache/commons/jcs/utils/net/**"/>
|
---|
287 | <exclude name="org/apache/commons/jcs/utils/props/**"/>
|
---|
288 | <exclude name="org/apache/commons/jcs/utils/servlet/**"/>
|
---|
289 | <exclude name="org/apache/commons/logging/impl/AvalonLogger.java"/>
|
---|
290 | <exclude name="org/apache/commons/logging/impl/Jdk13LumberjackLogger.java"/>
|
---|
291 | <exclude name="org/apache/commons/logging/impl/Log4JLogger.java"/>
|
---|
292 | <exclude name="org/apache/commons/logging/impl/LogKitLogger.java"/>
|
---|
293 | <exclude name="org/apache/commons/logging/impl/ServletContextCleaner.java"/>
|
---|
294 | </javac>
|
---|
295 | </target>
|
---|
296 | <target name="compile-jmapviewer" depends="init">
|
---|
297 | <!-- JMapViewer -->
|
---|
298 | <javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}"
|
---|
299 | excludes="com/**,javax/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/Demo.java,org/openstreetmap/gui/jmapviewer/JMapViewerTree.java,org/openstreetmap/gui/jmapviewer/checkBoxTree/**,org/openstreetmap/josm/**,gnu/**"
|
---|
300 | destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
|
---|
301 | <compilerclasspath>
|
---|
302 | <pathelement location="${error_prone_ant.jar}"/>
|
---|
303 | </compilerclasspath>
|
---|
304 | <compilerarg value="-Xlint:cast"/>
|
---|
305 | <compilerarg value="-Xlint:deprecation"/>
|
---|
306 | <compilerarg value="-Xlint:dep-ann"/>
|
---|
307 | <compilerarg value="-Xlint:divzero"/>
|
---|
308 | <compilerarg value="-Xlint:empty"/>
|
---|
309 | <compilerarg value="-Xlint:finally"/>
|
---|
310 | <compilerarg value="-Xlint:overrides"/>
|
---|
311 | <!--<compilerarg value="-Xlint:rawtypes"/>-->
|
---|
312 | <compilerarg value="-Xlint:static"/>
|
---|
313 | <compilerarg value="-Xlint:try"/>
|
---|
314 | <compilerarg value="-Xlint:unchecked"/>
|
---|
315 | <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
|
---|
316 | <compilerarg value="-XDignore.symbol.file"/>
|
---|
317 | <compilerarg value="-Xep:ReferenceEquality:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
|
---|
318 | <compilerarg line="-Xmaxwarns 1000"/>
|
---|
319 | </javac>
|
---|
320 | </target>
|
---|
321 | <target name="compile" depends="init,javacc,compile-cots,compile-jmapviewer">
|
---|
322 | <!-- JOSM -->
|
---|
323 | <javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}"
|
---|
324 | excludes="com/**,javax/**,gnu/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/**"
|
---|
325 | destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
|
---|
326 | <compilerclasspath>
|
---|
327 | <pathelement location="${error_prone_ant.jar}"/>
|
---|
328 | </compilerclasspath>
|
---|
329 | <compilerarg value="-Xlint:cast"/>
|
---|
330 | <compilerarg value="-Xlint:deprecation"/>
|
---|
331 | <compilerarg value="-Xlint:dep-ann"/>
|
---|
332 | <compilerarg value="-Xlint:divzero"/>
|
---|
333 | <compilerarg value="-Xlint:empty"/>
|
---|
334 | <compilerarg value="-Xlint:finally"/>
|
---|
335 | <compilerarg value="-Xlint:overrides"/>
|
---|
336 | <!--<compilerarg value="-Xlint:rawtypes"/>-->
|
---|
337 | <compilerarg value="-Xlint:static"/>
|
---|
338 | <compilerarg value="-Xlint:try"/>
|
---|
339 | <compilerarg value="-Xlint:unchecked"/>
|
---|
340 | <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
|
---|
341 | <compilerarg value="-XDignore.symbol.file"/>
|
---|
342 | <compilerarg value="-Xep:ReferenceEquality:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
|
---|
343 | <compilerarg value="-Xep:ImmutableEnumChecker:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
|
---|
344 | <compilerarg value="-Xep:FutureReturnValueIgnored:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
|
---|
345 | <compilerarg value="-Xep:FloatingPointLiteralPrecision:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
|
---|
346 | <compilerarg value="-Xep:ShortCircuitBoolean:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
|
---|
347 | <compilerarg value="-Xep:JdkObsolete:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
|
---|
348 | <compilerarg line="-Xmaxwarns 1000"/>
|
---|
349 | <exclude name="org/openstreetmap/josm/io/audio/JavaFxMediaPlayer.java" if:set="noJavaFX"/>
|
---|
350 | </javac>
|
---|
351 |
|
---|
352 | <copy todir="build" failonerror="no" includeemptydirs="no">
|
---|
353 | <fileset dir="resources"/>
|
---|
354 | </copy>
|
---|
355 | </target>
|
---|
356 | <target name="init" depends="init-properties">
|
---|
357 | <uptodate property="javacc.notRequired" targetfile="${mapcss.dir}/parsergen/MapCSSParser.java" >
|
---|
358 | <srcfiles dir="${mapcss.dir}" includes="MapCSSParser.jj"/>
|
---|
359 | </uptodate>
|
---|
360 | <mkdir dir="${build.dir}"/>
|
---|
361 | <mkdir dir="${dist.dir}"/>
|
---|
362 | </target>
|
---|
363 | <target name="javadoc" depends="init-properties">
|
---|
364 | <javadoc destdir="javadoc"
|
---|
365 | sourcepath="${src.dir}"
|
---|
366 | encoding="UTF-8"
|
---|
367 | packagenames="org.openstreetmap.josm.*,org.openstreetmap.gui.jmapviewer.*"
|
---|
368 | excludepackagenames="org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.*"
|
---|
369 | windowtitle="JOSM"
|
---|
370 | use="true"
|
---|
371 | private="true"
|
---|
372 | linksource="true"
|
---|
373 | author="false">
|
---|
374 | <link href="http://docs.oracle.com/javase/8/docs/api"/>
|
---|
375 | <doctitle><![CDATA[<h2>JOSM - Javadoc</h2>]]></doctitle>
|
---|
376 | <bottom><![CDATA[<a href="https://josm.openstreetmap.de/">JOSM</a>]]></bottom>
|
---|
377 | <arg value="--add-exports" if:set="isJava9" />
|
---|
378 | <arg value="java.base/sun.security.util=ALL-UNNAMED" if:set="isJava9" />
|
---|
379 | <arg value="--add-exports" if:set="isJava9" />
|
---|
380 | <arg value="java.base/sun.security.x509=ALL-UNNAMED" if:set="isJava9" />
|
---|
381 | <arg value="--add-exports" if:set="isJava9" />
|
---|
382 | <arg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" if:set="isJava9" />
|
---|
383 | </javadoc>
|
---|
384 | </target>
|
---|
385 | <target name="clean" depends="init-properties">
|
---|
386 | <delete dir="${build.dir}"/>
|
---|
387 | <delete dir="${proj-build.dir}"/>
|
---|
388 | <delete dir="${checkstyle-build.dir}"/>
|
---|
389 | <delete dir="${dist.dir}"/>
|
---|
390 | <delete dir="${mapcss.dir}/parsergen"/>
|
---|
391 | <delete file="${src.dir}/org/w3/_2001/xmlschema/Adapter1.java"/>
|
---|
392 | <delete dir="${src.dir}/org/openstreetmap/josm/data/imagery/types"/>
|
---|
393 | <delete file="${epsg.output}"/>
|
---|
394 | <delete file="${pmd.dir}/cache"/>
|
---|
395 | </target>
|
---|
396 | <macrodef name="init-test-preferences">
|
---|
397 | <attribute name="testfamily"/>
|
---|
398 | <sequential>
|
---|
399 | <copy file="${test.dir}/config/preferences.template.xml" tofile="${test.dir}/config/@{testfamily}-josm.home/preferences.xml"/>
|
---|
400 | <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/>
|
---|
401 | <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/>
|
---|
402 | </sequential>
|
---|
403 | </macrodef>
|
---|
404 | <target name="test-init" depends="init-properties">
|
---|
405 | <mkdir dir="${test.dir}/build"/>
|
---|
406 | <mkdir dir="${test.dir}/build/unit"/>
|
---|
407 | <mkdir dir="${test.dir}/build/functional"/>
|
---|
408 | <mkdir dir="${test.dir}/build/performance"/>
|
---|
409 | <mkdir dir="${test.dir}/report"/>
|
---|
410 | <init-test-preferences testfamily="unit"/>
|
---|
411 | <init-test-preferences testfamily="functional"/>
|
---|
412 | <init-test-preferences testfamily="performance"/>
|
---|
413 | <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="${tools.dir}/jacocoant.jar" />
|
---|
414 | </target>
|
---|
415 | <target name="test-clean" depends="init-properties">
|
---|
416 | <delete dir="${test.dir}/build"/>
|
---|
417 | <delete dir="${test.dir}/report"/>
|
---|
418 | <delete file="${test.dir}/jacoco.exec" />
|
---|
419 | <delete file="${test.dir}/jacocoIT.exec" />
|
---|
420 | <delete file="${test.dir}/config/unit-josm.home" failonerror="false"/>
|
---|
421 | <delete file="${test.dir}/config/functional-josm.home" failonerror="false"/>
|
---|
422 | <delete file="${test.dir}/config/performance-josm.home" failonerror="false"/>
|
---|
423 | </target>
|
---|
424 | <macrodef name="call-groovyc">
|
---|
425 | <attribute name="testfamily"/>
|
---|
426 | <element name="cp-elements"/>
|
---|
427 | <sequential>
|
---|
428 | <groovyc srcdir="${test.dir}/@{testfamily}" destdir="${test.dir}/build/@{testfamily}" encoding="UTF-8">
|
---|
429 | <classpath>
|
---|
430 | <cp-elements/>
|
---|
431 | </classpath>
|
---|
432 | <javac target="${java.lang.version}" source="${java.lang.version}" debug="on" encoding="UTF-8">
|
---|
433 | <compilerarg value="-Xlint:all"/>
|
---|
434 | <compilerarg value="-Xlint:-serial"/>
|
---|
435 | </javac>
|
---|
436 | </groovyc>
|
---|
437 | </sequential>
|
---|
438 | </macrodef>
|
---|
439 | <target name="test-compile" depends="test-init,dist">
|
---|
440 | <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="${groovy.jar}"/>
|
---|
441 | <call-groovyc testfamily="unit">
|
---|
442 | <cp-elements>
|
---|
443 | <path refid="test.classpath"/>
|
---|
444 | </cp-elements>
|
---|
445 | </call-groovyc>
|
---|
446 | <call-groovyc testfamily="functional">
|
---|
447 | <cp-elements>
|
---|
448 | <path refid="test.classpath"/>
|
---|
449 | <pathelement path="${test.dir}/build/unit"/>
|
---|
450 | </cp-elements>
|
---|
451 | </call-groovyc>
|
---|
452 | <call-groovyc testfamily="performance">
|
---|
453 | <cp-elements>
|
---|
454 | <path refid="test.classpath"/>
|
---|
455 | <pathelement path="${test.dir}/build/unit"/>
|
---|
456 | </cp-elements>
|
---|
457 | </call-groovyc>
|
---|
458 | </target>
|
---|
459 | <macrodef name="call-junit">
|
---|
460 | <attribute name="testfamily"/>
|
---|
461 | <attribute name="testITsuffix" default=""/>
|
---|
462 | <attribute name="coverage" default="true"/>
|
---|
463 | <sequential>
|
---|
464 | <echo message="Running @{testfamily}@{testITsuffix} tests with JUnit"/>
|
---|
465 | <jacoco:coverage destfile="${test.dir}/jacoco@{testITsuffix}.exec" enabled="@{coverage}" includes="${jacoco.includes}"
|
---|
466 | inclbootstrapclasses="${jacoco.inclbootstrapclasses}" inclnolocationclasses="${jacoco.inclnolocationclasses}">
|
---|
467 | <junit printsummary="yes" fork="true" forkmode="once">
|
---|
468 | <jvmarg value="-Dfile.encoding=UTF-8"/>
|
---|
469 | <jvmarg value="--add-modules" if:set="isJava9" />
|
---|
470 | <jvmarg value="java.activation,java.se.ee" if:set="isJava9" />
|
---|
471 | <jvmarg value="--add-exports" if:set="isJava9" />
|
---|
472 | <jvmarg value="java.base/sun.security.util=ALL-UNNAMED" if:set="isJava9" />
|
---|
473 | <jvmarg value="--add-exports" if:set="isJava9" />
|
---|
474 | <jvmarg value="java.base/sun.security.x509=ALL-UNNAMED" if:set="isJava9" />
|
---|
475 | <jvmarg value="--add-exports" if:set="isJava9" />
|
---|
476 | <jvmarg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" if:set="isJava9" />
|
---|
477 | <jvmarg value="--add-exports" if:set="isJava9" />
|
---|
478 | <jvmarg value="jdk.deploy/com.sun.deploy.config=ALL-UNNAMED" if:set="isJava9" />
|
---|
479 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
480 | <jvmarg value="java.base/java.io=ALL-UNNAMED" if:set="isJava9" />
|
---|
481 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
482 | <jvmarg value="java.base/java.lang=ALL-UNNAMED" if:set="isJava9" />
|
---|
483 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
484 | <jvmarg value="java.base/java.nio=ALL-UNNAMED" if:set="isJava9" />
|
---|
485 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
486 | <jvmarg value="java.base/java.text=ALL-UNNAMED" if:set="isJava9" />
|
---|
487 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
488 | <jvmarg value="java.base/java.util=ALL-UNNAMED" if:set="isJava9" />
|
---|
489 | <jvmarg value="--add-opens" if:set="isJava9" />
|
---|
490 | <jvmarg value="java.desktop/java.awt=ALL-UNNAMED" if:set="isJava9" />
|
---|
491 | <sysproperty key="josm.home" value="${test.dir}/config/@{testfamily}-josm.home"/>
|
---|
492 | <sysproperty key="josm.test.data" value="${test.dir}/data"/>
|
---|
493 | <sysproperty key="java.awt.headless" value="true"/>
|
---|
494 | <sysproperty key="glass.platform" value="Monocle"/>
|
---|
495 | <sysproperty key="monocle.platform" value="Headless"/>
|
---|
496 | <sysproperty key="prism.order" value="sw"/>
|
---|
497 | <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
|
---|
498 | <classpath>
|
---|
499 | <path refid="test.classpath"/>
|
---|
500 | <pathelement path="${test.dir}/build/unit"/>
|
---|
501 | <pathelement path="${test.dir}/build/@{testfamily}"/>
|
---|
502 | <pathelement path="${test.dir}/config"/>
|
---|
503 | </classpath>
|
---|
504 | <formatter type="plain"/>
|
---|
505 | <formatter type="xml"/>
|
---|
506 | <batchtest fork="yes" todir="${test.dir}/report">
|
---|
507 | <fileset dir="${test.dir}/build/@{testfamily}" includes="**/*Test@{testITsuffix}.class"/>
|
---|
508 | </batchtest>
|
---|
509 | </junit>
|
---|
510 | </jacoco:coverage>
|
---|
511 | </sequential>
|
---|
512 | </macrodef>
|
---|
513 | <target name="test" depends="test-compile" unless="test.notRequired"
|
---|
514 | description="Run unit and functional tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
|
---|
515 | <call-junit testfamily="unit"/>
|
---|
516 | <call-junit testfamily="functional"/>
|
---|
517 | </target>
|
---|
518 | <target name="test-it" depends="test-compile" unless="test-it.notRequired"
|
---|
519 | description="Run integration tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
|
---|
520 | <call-junit testfamily="unit" testITsuffix="IT"/>
|
---|
521 | <call-junit testfamily="functional" testITsuffix="IT"/>
|
---|
522 | </target>
|
---|
523 | <target name="test-perf" depends="test-compile" unless="test-perf.notRequired"
|
---|
524 | description="Run performance tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
|
---|
525 | <call-junit testfamily="performance" coverage="false"/>
|
---|
526 | </target>
|
---|
527 | <target name="test-html" depends="test, test-it, test-perf" description="Generate HTML test reports">
|
---|
528 | <!-- May require additional ant dependencies like ant-trax package -->
|
---|
529 | <junitreport todir="${test.dir}/report">
|
---|
530 | <fileset dir="${test.dir}/report">
|
---|
531 | <include name="TEST-*.xml"/>
|
---|
532 | </fileset>
|
---|
533 | <report todir="${test.dir}/report/html"/>
|
---|
534 | </junitreport>
|
---|
535 | <jacoco:report>
|
---|
536 | <executiondata>
|
---|
537 | <fileset dir="${test.dir}" includes="*.exec"/>
|
---|
538 | </executiondata>
|
---|
539 | <structure name="JOSM Test Coverage">
|
---|
540 | <classfiles>
|
---|
541 | <fileset dir="${build.dir}" includes="org/openstreetmap/"/>
|
---|
542 | </classfiles>
|
---|
543 | <sourcefiles encoding="UTF-8">
|
---|
544 | <fileset dir="${src.dir}" includes="org/openstreetmap/"/>
|
---|
545 | </sourcefiles>
|
---|
546 | </structure>
|
---|
547 | <html destdir="${test.dir}/report/jacoco"/>
|
---|
548 | </jacoco:report>
|
---|
549 | </target>
|
---|
550 | <target name="dist-optimized" depends="dist">
|
---|
551 | <taskdef resource="proguard/ant/task.properties" classpath="${tools.dir}/proguard.jar"/>
|
---|
552 | <proguard>
|
---|
553 | -injars ${dist.jar}
|
---|
554 | -outjars ${dist-optimized.jar}
|
---|
555 |
|
---|
556 | -libraryjars ${java.home}/lib
|
---|
557 |
|
---|
558 | -dontoptimize
|
---|
559 | -dontobfuscate
|
---|
560 |
|
---|
561 | # These options probably are not necessary (and make processing a bit slower)
|
---|
562 | -dontskipnonpubliclibraryclasses
|
---|
563 | -dontskipnonpubliclibraryclassmembers
|
---|
564 |
|
---|
565 | -keepclasseswithmembers public class org.openstreetmap.josm.gui.MainApplication {
|
---|
566 | public static void main(java.lang.String[]);
|
---|
567 | }
|
---|
568 |
|
---|
569 | -keep class * extends org.openstreetmap.josm.io.FileImporter
|
---|
570 | -keep class * extends org.openstreetmap.josm.io.FileExporter
|
---|
571 | -keep class org.openstreetmap.josm.actions.search.SearchCompiler$Never
|
---|
572 | -keep class org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory$PseudoClasses {
|
---|
573 | static boolean *(org.openstreetmap.josm.gui.mappaint.Environment);
|
---|
574 | }
|
---|
575 | -keep class org.apache.commons.logging.impl.*
|
---|
576 |
|
---|
577 | -keepclassmembers enum * {
|
---|
578 | public static **[] values();
|
---|
579 | public static ** valueOf(java.lang.String);
|
---|
580 | }
|
---|
581 |
|
---|
582 | # Keep unused public classes and methods (needed for plugins)
|
---|
583 | -keep public class * {
|
---|
584 | public protected *;
|
---|
585 | }
|
---|
586 |
|
---|
587 | # Keep serialization code
|
---|
588 | -keepclassmembers class * implements java.io.Serializable {
|
---|
589 | static final long serialVersionUID;
|
---|
590 | private static final java.io.ObjectStreamField[] serialPersistentFields;
|
---|
591 | private void writeObject(java.io.ObjectOutputStream);
|
---|
592 | private void readObject(java.io.ObjectInputStream);
|
---|
593 | java.lang.Object writeReplace();
|
---|
594 | java.lang.Object readResolve();
|
---|
595 | }
|
---|
596 |
|
---|
597 | # Disable annoying [proguard] Note: the configuration keeps the entry point '...', but not the descriptor class '...'.
|
---|
598 | # This note should not be a problem as we don't use obfuscation
|
---|
599 | -dontnote
|
---|
600 | </proguard>
|
---|
601 | </target>
|
---|
602 | <!-- Proguard does not support Java 9 : http://sourceforge.net/p/proguard/bugs/551/ -->
|
---|
603 | <target name="dist-optimized-report" depends="dist-optimized" unless="isJava9">
|
---|
604 | <!-- generate difference report between optimized jar and normal one -->
|
---|
605 | <exec executable="perl" dir="${basedir}">
|
---|
606 | <arg value="${tools.dir}/japicc/japi-compliance-checker.pl"/>
|
---|
607 | <arg value="--lib=JOSM"/>
|
---|
608 | <arg value="--keep-internal"/>
|
---|
609 | <arg value="--v1=${version.entry.commit.revision}"/>
|
---|
610 | <arg value="--v2=${version.entry.commit.revision}-optimized"/>
|
---|
611 | <arg value="--report-path=${dist.dir}/compat_report.html"/>
|
---|
612 | <arg value="${dist.jar}"/>
|
---|
613 | <arg value="${dist-optimized.jar}"/>
|
---|
614 | </exec>
|
---|
615 | </target>
|
---|
616 | <target name="check-plugins" depends="dist-optimized" description="Check of plugins binary compatibility">
|
---|
617 | <local name="dir"/>
|
---|
618 | <local name="plugins"/>
|
---|
619 | <property name="dir" value="plugin-check"/>
|
---|
620 | <typedef uri="antlib:org.codehaus.mojo.animal_sniffer">
|
---|
621 | <classpath path="${tools.dir}/animal-sniffer-ant-tasks.jar"/>
|
---|
622 | </typedef>
|
---|
623 | <mkdir dir="${dir}"/>
|
---|
624 | <!-- List of deprecated plugins -->
|
---|
625 | <loadfile property="deprecated-plugins" srcFile="${src.dir}/org/openstreetmap/josm/plugins/PluginHandler.java">
|
---|
626 | <filterchain>
|
---|
627 | <linecontains>
|
---|
628 | <contains value="new DeprecatedPlugin("/>
|
---|
629 | </linecontains>
|
---|
630 | <tokenfilter>
|
---|
631 | <replaceregex pattern=".*new DeprecatedPlugin\("(.+?)".*" replace="\1|" flags="gi"/>
|
---|
632 | </tokenfilter>
|
---|
633 | <striplinebreaks/>
|
---|
634 | <tokenfilter>
|
---|
635 | <replaceregex pattern="\|$" replace="" flags="gi"/>
|
---|
636 | </tokenfilter>
|
---|
637 | </filterchain>
|
---|
638 | </loadfile>
|
---|
639 | <!-- Download list of plugins -->
|
---|
640 | <loadresource property="plugins">
|
---|
641 | <url url="https://josm.openstreetmap.de/plugin"/>
|
---|
642 | <filterchain>
|
---|
643 | <linecontainsregexp negate="true">
|
---|
644 | <regexp pattern="^\t.*"/>
|
---|
645 | </linecontainsregexp>
|
---|
646 | <linecontainsregexp negate="true">
|
---|
647 | <regexp pattern="${deprecated-plugins}"/>
|
---|
648 | </linecontainsregexp>
|
---|
649 | <tokenfilter>
|
---|
650 | <replaceregex pattern="^.*;" replace="" flags="gi"/>
|
---|
651 | </tokenfilter>
|
---|
652 | </filterchain>
|
---|
653 | </loadresource>
|
---|
654 | <!-- Delete files that are not in plugin list (like old plugins) -->
|
---|
655 | <loadresource property="file-list">
|
---|
656 | <propertyresource name="plugins"/>
|
---|
657 | <filterchain>
|
---|
658 | <tokenfilter>
|
---|
659 | <replaceregex pattern="^.*/(.*)$" replace="\1\|" flags=""/>
|
---|
660 | </tokenfilter>
|
---|
661 | <striplinebreaks/>
|
---|
662 | <tokenfilter>
|
---|
663 | <replaceregex pattern="\|$" replace="" flags="gi"/>
|
---|
664 | </tokenfilter>
|
---|
665 | </filterchain>
|
---|
666 | </loadresource>
|
---|
667 | <delete>
|
---|
668 | <restrict>
|
---|
669 | <fileset dir="${dir}"/>
|
---|
670 | <not>
|
---|
671 | <name regex="${file-list}"/>
|
---|
672 | </not>
|
---|
673 | </restrict>
|
---|
674 | </delete>
|
---|
675 | <!-- Download plugins -->
|
---|
676 | <copy todir="${dir}" flatten="true" verbose="true" failonerror="false">
|
---|
677 | <resourcelist>
|
---|
678 | <string value="${plugins}"/>
|
---|
679 | </resourcelist>
|
---|
680 | </copy>
|
---|
681 | <!-- Check plugins -->
|
---|
682 | <as:build-signatures destfile="${dir}/api.sig">
|
---|
683 | <path>
|
---|
684 | <fileset file="${dist-optimized.jar}"/>
|
---|
685 | <fileset file="${java.home}/lib/rt.jar"/>
|
---|
686 | <fileset file="${java.home}/lib/jce.jar"/>
|
---|
687 | <fileset file="${java.home}/lib/ext/jfxrt.jar"/>
|
---|
688 | </path>
|
---|
689 | </as:build-signatures>
|
---|
690 | <as:check-signature signature="${dir}/api.sig" failonerror="false">
|
---|
691 | <ignore classname="au.*"/>
|
---|
692 | <ignore classname="com.*"/>
|
---|
693 | <ignore classname="de.*"/>
|
---|
694 | <ignore classname="edu.*"/>
|
---|
695 | <ignore classname="groovy.*"/>
|
---|
696 | <ignore classname="it.*"/>
|
---|
697 | <ignore classname="javax.*"/>
|
---|
698 | <ignore classname="jogamp.*"/>
|
---|
699 | <ignore classname="junit.*"/>
|
---|
700 | <ignore classname="kdu_jni.*"/>
|
---|
701 | <ignore classname="net.*"/>
|
---|
702 | <ignore classname="netscape.*"/>
|
---|
703 | <ignore classname="nu.*"/>
|
---|
704 | <ignore classname="oracle.*"/>
|
---|
705 | <ignore classname="org.apache.*"/>
|
---|
706 | <ignore classname="org.bouncycastle.*"/>
|
---|
707 | <ignore classname="org.codehaus.*"/>
|
---|
708 | <ignore classname="org.dom4j.*"/>
|
---|
709 | <ignore classname="org.eclipse.*"/>
|
---|
710 | <ignore classname="org.ejml.*"/>
|
---|
711 | <ignore classname="org.gdal.*"/>
|
---|
712 | <ignore classname="org.hibernate.*"/>
|
---|
713 | <ignore classname="org.hsqldb.*"/>
|
---|
714 | <ignore classname="org.ibex.*"/>
|
---|
715 | <ignore classname="org.iso_relax.*"/>
|
---|
716 | <ignore classname="org.jaitools.*"/>
|
---|
717 | <ignore classname="org.jaxen.*"/>
|
---|
718 | <ignore classname="org.jboss.*"/>
|
---|
719 | <ignore classname="org.jdom2.*"/>
|
---|
720 | <ignore classname="org.jfree.*"/>
|
---|
721 | <ignore classname="org.jgraph.*"/>
|
---|
722 | <ignore classname="org.joda.*"/>
|
---|
723 | <ignore classname="org.junit.*"/>
|
---|
724 | <ignore classname="org.jvnet.*"/>
|
---|
725 | <ignore classname="org.kxml2.*"/>
|
---|
726 | <ignore classname="org.objectweb.*"/>
|
---|
727 | <ignore classname="org.osgi.*"/>
|
---|
728 | <ignore classname="org.postgresql.*"/>
|
---|
729 | <ignore classname="org.python.*"/>
|
---|
730 | <ignore classname="org.seasar.*"/>
|
---|
731 | <ignore classname="org.slf4j.*"/>
|
---|
732 | <ignore classname="org.springframework.*"/>
|
---|
733 | <ignore classname="org.testng.*"/>
|
---|
734 | <ignore classname="org.w3c.*"/>
|
---|
735 | <ignore classname="org.zeromq.*"/>
|
---|
736 | <!-- plugins used by another ones -->
|
---|
737 | <ignore classname="org.openstreetmap.josm.plugins.geotools.*"/>
|
---|
738 | <ignore classname="org.openstreetmap.josm.plugins.jna.*"/>
|
---|
739 | <ignore classname="org.openstreetmap.josm.plugins.jts.*"/>
|
---|
740 | <ignore classname="org.openstreetmap.josm.plugins.log4j.*"/>
|
---|
741 | <ignore classname="org.openstreetmap.josm.plugins.utilsplugin2.*"/>
|
---|
742 | <ignore classname="sun.*"/>
|
---|
743 | <path path="${dir}"/>
|
---|
744 | </as:check-signature>
|
---|
745 | </target>
|
---|
746 |
|
---|
747 | <macrodef name="_taginfo">
|
---|
748 | <attribute name="type"/>
|
---|
749 | <attribute name="output"/>
|
---|
750 | <sequential>
|
---|
751 | <echo message="Generating Taginfo for type @{type} to @{output}"/>
|
---|
752 | <groovy src="${taginfoextract}" classpath="${dist.jar}:${spotbugs.dir}/spotbugs-annotations.jar">
|
---|
753 | <arg value="-t"/>
|
---|
754 | <arg value="@{type}"/>
|
---|
755 | <arg value="--noexit"/>
|
---|
756 | <arg value="--svnweb"/>
|
---|
757 | <arg value="--imgurlprefix"/>
|
---|
758 | <arg value="${imgurlprefix}"/>
|
---|
759 | <arg value="-o"/>
|
---|
760 | <arg value="@{output}"/>
|
---|
761 | </groovy>
|
---|
762 | </sequential>
|
---|
763 | </macrodef>
|
---|
764 |
|
---|
765 | <target name="taginfo" depends="dist">
|
---|
766 | <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${groovy.jar};${tools.dir}/commons-cli-1.3.1.jar"/>
|
---|
767 | <property name="taginfoextract" value="scripts/TagInfoExtract.groovy"/>
|
---|
768 | <property name="imgurlprefix" value="http://josm.openstreetmap.de/download/taginfo/taginfo-img"/>
|
---|
769 | <_taginfo type="mappaint" output="taginfo_style.json"/>
|
---|
770 | <_taginfo type="presets" output="taginfo_presets.json"/>
|
---|
771 | <_taginfo type="external_presets" output="taginfo_external_presets.json"/>
|
---|
772 | </target>
|
---|
773 |
|
---|
774 | <target name="imageryindex" depends="init-properties">
|
---|
775 | <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${groovy.jar};${tools.dir}/commons-cli-1.3.1.jar"/>
|
---|
776 | <echo message="Checking editor imagery difference"/>
|
---|
777 | <groovy src="scripts/SyncEditorLayerIndex.groovy" classpath="${dist.jar}">
|
---|
778 | <arg value="-noeli"/>
|
---|
779 | <arg value="-p"/>
|
---|
780 | <arg value="imagery_eliout.imagery.xml"/>
|
---|
781 | <arg value="-q"/>
|
---|
782 | <arg value="imagery_josmout.imagery.xml"/>
|
---|
783 | </groovy>
|
---|
784 | </target>
|
---|
785 |
|
---|
786 | <target name="imageryindexdownload">
|
---|
787 | <exec append="false" executable="wget" failifexecutionfails="true">
|
---|
788 | <arg value="https://josm.openstreetmap.de/maps"/>
|
---|
789 | <arg value="-O"/>
|
---|
790 | <arg value="imagery_josm.imagery.xml"/>
|
---|
791 | <arg value="--unlink"/>
|
---|
792 | </exec>
|
---|
793 | <exec append="false" executable="wget" failifexecutionfails="true">
|
---|
794 | <arg value="https://josm.openstreetmap.de/wiki/ImageryCompareIgnores?format=txt"/>
|
---|
795 | <arg value="-O"/>
|
---|
796 | <arg value="imagery_josm.ignores.txt"/>
|
---|
797 | <arg value="--unlink"/>
|
---|
798 | </exec>
|
---|
799 | <exec append="false" executable="wget" failifexecutionfails="true">
|
---|
800 | <arg value="https://raw.githubusercontent.com/osmlab/editor-layer-index/gh-pages/imagery.geojson"/>
|
---|
801 | <arg value="-O"/>
|
---|
802 | <arg value="imagery_eli.geojson"/>
|
---|
803 | <arg value="--unlink"/>
|
---|
804 | </exec>
|
---|
805 | <antcall target="imageryindex"/>
|
---|
806 | </target>
|
---|
807 |
|
---|
808 | <target name="checkstyle-compile" depends="init-properties">
|
---|
809 | <mkdir dir="${checkstyle-build.dir}"/>
|
---|
810 | <javac sourcepath="" srcdir="${checkstyle.dir}/src" failonerror="true"
|
---|
811 | destdir="${checkstyle-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on"
|
---|
812 | includeantruntime="false" createMissingPackageInfoClass="false"
|
---|
813 | encoding="UTF-8" classpath="${checkstyle.dir}/checkstyle-all.jar">
|
---|
814 | </javac>
|
---|
815 | </target>
|
---|
816 | <target name="checkstyle" depends="checkstyle-compile">
|
---|
817 | <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties"
|
---|
818 | classpath="${checkstyle.dir}/checkstyle-all.jar:${checkstyle-build.dir}"/>
|
---|
819 | <checkstyle config="${checkstyle.dir}/josm_checks.xml">
|
---|
820 | <fileset dir="${base.dir}/src/org/openstreetmap/josm" includes="**/*.java"
|
---|
821 | excludes="gui/mappaint/mapcss/parsergen/*.java"/>
|
---|
822 | <fileset dir="${base.dir}/test" includes="**/*.java"/>
|
---|
823 | <formatter type="plain"/>
|
---|
824 | <formatter type="xml" toFile="checkstyle-josm.xml"/>
|
---|
825 | </checkstyle>
|
---|
826 | </target>
|
---|
827 |
|
---|
828 | <target name="spotbugs" depends="dist">
|
---|
829 | <taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${spotbugs.dir}/spotbugs-ant.jar"/>
|
---|
830 | <path id="spotbugs-classpath">
|
---|
831 | <fileset dir="${spotbugs.dir}">
|
---|
832 | <include name="*.jar"/>
|
---|
833 | </fileset>
|
---|
834 | </path>
|
---|
835 | <property name="spotbugs-classpath" refid="spotbugs-classpath"/>
|
---|
836 | <spotbugs output="xml"
|
---|
837 | outputFile="spotbugs-josm.xml"
|
---|
838 | classpath="${spotbugs-classpath}"
|
---|
839 | pluginList=""
|
---|
840 | excludeFilter="${spotbugs.dir}/josm-filter.xml"
|
---|
841 | effort="max"
|
---|
842 | reportLevel="low"
|
---|
843 | >
|
---|
844 | <sourcePath path="${base.dir}/src" />
|
---|
845 | <class location="${dist.jar}" />
|
---|
846 | </spotbugs>
|
---|
847 | </target>
|
---|
848 |
|
---|
849 | <target name="pmd" depends="init-properties">
|
---|
850 | <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpath="${toString:pmd.classpath}"/>
|
---|
851 | <pmd shortFilenames="true" cacheLocation="${pmd.dir}/cache" encoding="UTF-8">
|
---|
852 | <sourceLanguage name="java" version="${java.lang.version}" />
|
---|
853 | <ruleset>${pmd.dir}/josm-ruleset.xml</ruleset>
|
---|
854 | <formatter type="text" toConsole="true" />
|
---|
855 | <formatter type="xml" toFile="pmd-josm.xml">
|
---|
856 | <param name="encoding" value="UTF-8" />
|
---|
857 | </formatter>
|
---|
858 | <fileset dir="${src.dir}">
|
---|
859 | <include name="org/openstreetmap/josm/**/*.java"/>
|
---|
860 | <exclude name="org/openstreetmap/josm/gui/mappaint/mapcss/parsergen/*.java" />
|
---|
861 | </fileset>
|
---|
862 | </pmd>
|
---|
863 | </target>
|
---|
864 |
|
---|
865 | <target name="run" depends="dist">
|
---|
866 | <java jar="${dist.jar}" fork="true">
|
---|
867 | <arg value="--set=expert=true"/>
|
---|
868 | <arg value="--set=remotecontrol.enabled=true"/>
|
---|
869 | <arg value="--set=debug.edt-checker.enable=false"/>
|
---|
870 | <jvmarg value="-Djosm.home=/tmp/.josm/"/>
|
---|
871 | </java>
|
---|
872 | </target>
|
---|
873 | <!--
|
---|
874 | ** Compile build script for generating projection list.
|
---|
875 | -->
|
---|
876 | <target name="epsg-compile" depends="init-properties">
|
---|
877 | <property name="proj-classpath" location="${build.dir}"/>
|
---|
878 | <mkdir dir="${proj-build.dir}"/>
|
---|
879 | <javac sourcepath="" srcdir="${base.dir}/scripts" failonerror="true"
|
---|
880 | destdir="${proj-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on"
|
---|
881 | includeantruntime="false" createMissingPackageInfoClass="false"
|
---|
882 | encoding="UTF-8" classpath="${proj-classpath}">
|
---|
883 | </javac>
|
---|
884 | </target>
|
---|
885 | <!--
|
---|
886 | ** generate projection list.
|
---|
887 | -->
|
---|
888 | <target name="epsg" depends="epsg-compile">
|
---|
889 | <touch file="${epsg.output}" mkdirs="true"/>
|
---|
890 | <java classname="BuildProjectionDefinitions" failonerror="true" fork="true">
|
---|
891 | <sysproperty key="java.awt.headless" value="true"/>
|
---|
892 | <classpath>
|
---|
893 | <pathelement path="${base.dir}"/>
|
---|
894 | <pathelement path="${proj-classpath}"/>
|
---|
895 | <pathelement path="${proj-build.dir}"/>
|
---|
896 | </classpath>
|
---|
897 | <arg value="${base.dir}"/>
|
---|
898 | </java>
|
---|
899 | </target>
|
---|
900 | </project>
|
---|