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