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