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