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