[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"/>
|
---|
[12016] | 27 | <property name="groovy.jar" location="${base.dir}/tools/groovy-all-2.4.11.jar"/>
|
---|
[11780] | 28 | <property name="error_prone_ant.jar" location="${base.dir}/tools/error_prone_ant-2.0.19.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>
|
---|
[11713] | 48 | <path id="pmd.classpath">
|
---|
| 49 | <fileset dir="${base.dir}/tools/pmd/">
|
---|
| 50 | <include name="*.jar"/>
|
---|
| 51 | </fileset>
|
---|
| 52 | </path>
|
---|
[9765] | 53 | </target>
|
---|
[4252] | 54 |
|
---|
[4166] | 55 | <!--
|
---|
[6133] | 56 | ** Used by Eclipse ant builder for updating
|
---|
| 57 | ** the REVISION file used by JOSM
|
---|
| 58 | -->
|
---|
[4166] | 59 | <target name="create-revision-eclipse">
|
---|
| 60 | <property name="revision.dir" value="bin"/>
|
---|
| 61 | <antcall target="create-revision"/>
|
---|
| 62 | </target>
|
---|
| 63 | <!--
|
---|
[6540] | 64 | ** Initializes the REVISION.XML file from SVN information
|
---|
[6133] | 65 | -->
|
---|
[9765] | 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">
|
---|
[4166] | 68 | <env key="LANG" value="C"/>
|
---|
| 69 | <arg value="info"/>
|
---|
| 70 | <arg value="--xml"/>
|
---|
| 71 | <arg value="."/>
|
---|
| 72 | </exec>
|
---|
[6585] | 73 | <condition property="svn.info.success">
|
---|
| 74 | <equals arg1="${svn.info.result}" arg2="0" />
|
---|
| 75 | </condition>
|
---|
[6540] | 76 | </target>
|
---|
| 77 | <!--
|
---|
| 78 | ** Initializes the REVISION.XML file from git information
|
---|
| 79 | -->
|
---|
[9765] | 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">
|
---|
[6540] | 82 | <arg value="log"/>
|
---|
| 83 | <arg value="-1"/>
|
---|
| 84 | <arg value="--grep=git-svn-id"/>
|
---|
[6545] | 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"/>
|
---|
[6540] | 91 | <arg value="HEAD"/>
|
---|
| 92 | </exec>
|
---|
[9765] | 93 | <replaceregexp file="${base.dir}/REVISION.XML" flags="s"
|
---|
[6545] | 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>"/>
|
---|
[6540] | 96 | </target>
|
---|
| 97 | <!--
|
---|
| 98 | ** Creates the REVISION file to be included in the distribution
|
---|
| 99 | -->
|
---|
[9765] | 100 | <target name="create-revision" depends="init-properties,init-svn-revision-xml,init-git-revision-xml">
|
---|
[6540] | 101 | <property name="revision.dir" value="${build.dir}"/>
|
---|
[9765] | 102 | <xmlproperty file="${base.dir}/REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
| 103 | <delete file="${base.dir}/REVISION.XML"/>
|
---|
[4166] | 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"/>
|
---|
[6540] | 108 | <property name="version.entry.commit.date" value="UNKNOWN"/>
|
---|
[4166] | 109 | <mkdir dir="${revision.dir}"/>
|
---|
[5362] | 110 | <!-- add Build-Name: ... when making special builds, e.g. DEBIAN -->
|
---|
[4166] | 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>
|
---|
[6540] | 118 | <!--
|
---|
| 119 | ** Check internal XML files against their XSD
|
---|
| 120 | -->
|
---|
[9765] | 121 | <target name="check-schemas" unless="check-schemas.notRequired" depends="init-properties">
|
---|
[6208] | 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>
|
---|
[6540] | 126 | <!--
|
---|
| 127 | ** Main target that builds JOSM and checks XML against schemas
|
---|
| 128 | -->
|
---|
[9133] | 129 | <target name="dist" depends="compile,create-revision,check-schemas,epsg">
|
---|
[4166] | 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 -->
|
---|
[9765] | 135 | <delete file="${dist.dir}/josm-custom.jar"/>
|
---|
| 136 | <jar destfile="${dist.dir}/josm-custom.jar" basedir="${build.dir}" level="${clevel}">
|
---|
[4166] | 137 | <!-- add attribute excludes="**/*BZip2*,**/*Bzip2*" to create a non-bzip2 supporting jar -->
|
---|
| 138 | <manifest>
|
---|
[11926] | 139 | <attribute name="Main-class" value="org.openstreetmap.josm.gui.MainApplication"/>
|
---|
[4166] | 140 | <attribute name="Main-Version" value="${version.entry.commit.revision} SVN"/>
|
---|
| 141 | <attribute name="Main-Date" value="${version.entry.commit.date}"/>
|
---|
[6341] | 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"/>
|
---|
[4166] | 145 | </manifest>
|
---|
| 146 | <zipfileset dir="images" prefix="images"/>
|
---|
| 147 | <zipfileset dir="data" prefix="data"/>
|
---|
| 148 | <zipfileset dir="styles" prefix="styles"/>
|
---|
[7133] | 149 | <zipfileset dir="${src.dir}/org/openstreetmap/gui/jmapviewer/images" prefix="org/openstreetmap/gui/jmapviewer/images"/>
|
---|
[4166] | 150 | </jar>
|
---|
| 151 | </target>
|
---|
[7001] | 152 | <!-- Mac OS X target -->
|
---|
[9765] | 153 | <target name="mac" depends="init-properties">
|
---|
[6217] | 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 -->
|
---|
[6945] | 157 | <bundleapp outputdirectory="${bundle.outdir}" name="JOSM" displayname="JOSM" executablename="JOSM" identifier="org.openstreetmap.josm"
|
---|
[6216] | 158 | mainclassname="org.openstreetmap.josm.gui.MainApplication"
|
---|
[6217] | 159 | copyright="JOSM, and all its integral parts, are released under the GNU General Public License v2 or later"
|
---|
[6216] | 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"
|
---|
[6217] | 164 | highResolutionCapable="true">
|
---|
[6216] | 165 |
|
---|
| 166 | <arch name="x86_64"/>
|
---|
| 167 | <arch name="i386"/>
|
---|
| 168 |
|
---|
[6945] | 169 | <classpath file="${bundle.jar}"/>
|
---|
[6216] | 170 |
|
---|
[7287] | 171 | <option value="-Xmx1024m"/>
|
---|
[6216] | 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>
|
---|
[9765] | 183 |
|
---|
[6217] | 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"/>
|
---|
[9765] | 186 |
|
---|
[6945] | 187 | <xmltask source="${bundle.outdir}/JOSM.app/Contents/Info.plist" dest="${bundle.outdir}/JOSM.app/Contents/Info.plist" indent="false">
|
---|
[7367] | 188 | <!-- remove empty CFBundleDocumentTypes definition -->
|
---|
| 189 | <remove path="/plist/dict/key[text()='CFBundleDocumentTypes']|/plist/dict/key[text()='CFBundleDocumentTypes']/following-sibling::array[1]"/>
|
---|
[7287] | 190 | <!-- insert our own keys -->
|
---|
| 191 | <insert position="before" path="/plist/dict/key[1]" file="macosx/JOSM.app/Contents/Info.plist_template.xml" />
|
---|
[6217] | 192 | </xmltask>
|
---|
[9765] | 193 |
|
---|
[6216] | 194 | <!-- create ZIP file with MacOS X application bundle -->
|
---|
[7001] | 195 | <zip destfile="${bundle.outdir}/josm-custom-macosx.zip" update="true">
|
---|
[6945] | 196 | <zipfileset dir="." includes="CONTRIBUTION README LICENSE"/>
|
---|
| 197 | <zipfileset dir="${bundle.outdir}" includes="JOSM.app/**/*" filemode="755" />
|
---|
[6216] | 198 | </zip>
|
---|
[6217] | 199 | </target>
|
---|
[7001] | 200 | <target name="distmac" depends="dist">
|
---|
| 201 | <antcall target="mac">
|
---|
[9765] | 202 | <param name="bundle.outdir" value="${dist.dir}"/>
|
---|
| 203 | <param name="bundle.jar" value="${dist.dir}/josm-custom.jar"/>
|
---|
[6945] | 204 | </antcall>
|
---|
| 205 | </target>
|
---|
[7839] | 206 | <!-- Windows target -->
|
---|
| 207 | <target name="distwin" depends="dist">
|
---|
[7842] | 208 | <exec dir="windows" executable="./josm-setup-unix.sh">
|
---|
[7839] | 209 | <arg value="${version.entry.commit.revision}"/>
|
---|
| 210 | <arg value="../dist/josm-custom.jar"/>
|
---|
| 211 | </exec>
|
---|
| 212 | </target>
|
---|
[5392] | 213 | <target name="javacc" depends="init" unless="javacc.notRequired">
|
---|
[4252] | 214 | <mkdir dir="${mapcss.dir}/parsergen"/>
|
---|
[11676] | 215 | <java classname="javacc" fork="true" failonerror="true">
|
---|
| 216 | <classpath path="${javacc.home}/javacc.jar"/>
|
---|
[7043] | 217 | <arg value="-DEBUG_PARSER=false"/>
|
---|
| 218 | <arg value="-DEBUG_TOKEN_MANAGER=false"/>
|
---|
[10580] | 219 | <arg value="-JDK_VERSION=1.8"/>
|
---|
[6446] | 220 | <arg value="-GRAMMAR_ENCODING=UTF-8"/>
|
---|
[4257] | 221 | <arg value="-OUTPUT_DIRECTORY=${mapcss.dir}/parsergen"/>
|
---|
| 222 | <arg value="${mapcss.dir}/MapCSSParser.jj"/>
|
---|
[11676] | 223 | </java>
|
---|
[4252] | 224 | </target>
|
---|
[8526] | 225 | <target name="compile" depends="init,javacc">
|
---|
[7068] | 226 | <!-- COTS -->
|
---|
[8173] | 227 | <javac srcdir="${src.dir}" includes="com/**,oauth/**,org/apache/commons/**,org/glassfish/**" nowarn="on" encoding="iso-8859-1"
|
---|
[10580] | 228 | destdir="build" target="1.8" source="1.8" debug="on" includeAntRuntime="false" createMissingPackageInfoClass="false">
|
---|
[7019] | 229 | <!-- get rid of "internal proprietary API" warning -->
|
---|
[7068] | 230 | <compilerarg value="-XDignore.symbol.file"/>
|
---|
[10832] | 231 | <exclude name="org/apache/commons/compress/compressors/bzip2/BZip2Utils.java"/>
|
---|
[12039] | 232 | <exclude name="org/apache/commons/compress/compressors/brotli/**"/>
|
---|
[8173] | 233 | <exclude name="org/apache/commons/compress/compressors/lzma/**"/>
|
---|
| 234 | <exclude name="org/apache/commons/compress/compressors/xz/**"/>
|
---|
| 235 | <exclude name="org/apache/commons/compress/compressors/CompressorStreamFactory.java"/>
|
---|
[11274] | 236 | <exclude name="org/apache/commons/compress/compressors/CompressorStreamProvider.java"/>
|
---|
[10832] | 237 | <exclude name="org/apache/commons/compress/compressors/CompressorException.java"/>
|
---|
| 238 | <exclude name="org/apache/commons/compress/compressors/FileNameUtil.java"/>
|
---|
[8173] | 239 | <exclude name="org/apache/commons/compress/compressors/deflate/**"/>
|
---|
| 240 | <exclude name="org/apache/commons/compress/compressors/gzip/**"/>
|
---|
[11471] | 241 | <exclude name="org/apache/commons/compress/compressors/lz4/**"/>
|
---|
[11478] | 242 | <exclude name="org/apache/commons/compress/compressors/lz77support/**"/>
|
---|
[8173] | 243 | <exclude name="org/apache/commons/compress/compressors/lzw/**"/>
|
---|
| 244 | <exclude name="org/apache/commons/compress/compressors/pack200/**"/>
|
---|
| 245 | <exclude name="org/apache/commons/compress/compressors/snappy/**"/>
|
---|
| 246 | <exclude name="org/apache/commons/compress/compressors/z/**"/>
|
---|
[11569] | 247 | <exclude name="org/apache/commons/compress/utils/ArchiveUtils.java"/>
|
---|
[10833] | 248 | <exclude name="org/apache/commons/jcs/JCS.java"/>
|
---|
[10866] | 249 | <exclude name="org/apache/commons/jcs/access/GroupCacheAccess.java"/>
|
---|
[10833] | 250 | <exclude name="org/apache/commons/jcs/access/PartitionedCacheAccess.java"/>
|
---|
[10866] | 251 | <exclude name="org/apache/commons/jcs/access/behavior/IGroupCacheAccess.java"/>
|
---|
| 252 | <exclude name="org/apache/commons/jcs/access/exception/InvalidGroupException.java"/>
|
---|
[10833] | 253 | <exclude name="org/apache/commons/jcs/admin/servlet/**"/>
|
---|
[10866] | 254 | <exclude name="org/apache/commons/jcs/auxiliary/AbstractAuxiliaryCacheMonitor.java"/>
|
---|
[8173] | 255 | <exclude name="org/apache/commons/jcs/auxiliary/disk/jdbc/**"/>
|
---|
[10866] | 256 | <exclude name="org/apache/commons/jcs/auxiliary/lateral/**"/>
|
---|
[8173] | 257 | <exclude name="org/apache/commons/jcs/auxiliary/remote/**"/>
|
---|
[10866] | 258 | <exclude name="org/apache/commons/jcs/engine/CacheAdaptor.java"/>
|
---|
| 259 | <exclude name="org/apache/commons/jcs/engine/CacheGroup.java"/>
|
---|
| 260 | <exclude name="org/apache/commons/jcs/engine/CacheWatchRepairable.java"/>
|
---|
[10833] | 261 | <exclude name="org/apache/commons/jcs/engine/Zombie*.java"/>
|
---|
[10866] | 262 | <exclude name="org/apache/commons/jcs/engine/logging/CacheEventLoggerDebugLogger.java"/>
|
---|
[10833] | 263 | <exclude name="org/apache/commons/jcs/utils/access/**"/>
|
---|
| 264 | <exclude name="org/apache/commons/jcs/utils/discovery/**"/>
|
---|
| 265 | <exclude name="org/apache/commons/jcs/utils/net/**"/>
|
---|
| 266 | <exclude name="org/apache/commons/jcs/utils/props/**"/>
|
---|
[8173] | 267 | <exclude name="org/apache/commons/jcs/utils/servlet/**"/>
|
---|
| 268 | <exclude name="org/apache/commons/logging/impl/AvalonLogger.java"/>
|
---|
| 269 | <exclude name="org/apache/commons/logging/impl/Jdk13LumberjackLogger.java"/>
|
---|
| 270 | <exclude name="org/apache/commons/logging/impl/Log4JLogger.java"/>
|
---|
| 271 | <exclude name="org/apache/commons/logging/impl/LogKitLogger.java"/>
|
---|
| 272 | <exclude name="org/apache/commons/logging/impl/ServletContextCleaner.java"/>
|
---|
[7019] | 273 | </javac>
|
---|
[8526] | 274 | <!-- JMapViewer -->
|
---|
[10628] | 275 | <javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}"
|
---|
[11926] | 276 | 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/**"
|
---|
[10580] | 277 | destdir="build" target="1.8" source="1.8" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
|
---|
[10581] | 278 | <compilerclasspath>
|
---|
| 279 | <pathelement location="${error_prone_ant.jar}"/>
|
---|
| 280 | </compilerclasspath>
|
---|
[7021] | 281 | <compilerarg value="-Xlint:cast"/>
|
---|
[4166] | 282 | <compilerarg value="-Xlint:deprecation"/>
|
---|
[7022] | 283 | <compilerarg value="-Xlint:dep-ann"/>
|
---|
| 284 | <compilerarg value="-Xlint:divzero"/>
|
---|
| 285 | <compilerarg value="-Xlint:empty"/>
|
---|
| 286 | <compilerarg value="-Xlint:finally"/>
|
---|
| 287 | <compilerarg value="-Xlint:overrides"/>
|
---|
| 288 | <!--<compilerarg value="-Xlint:rawtypes"/>-->
|
---|
| 289 | <compilerarg value="-Xlint:static"/>
|
---|
| 290 | <compilerarg value="-Xlint:try"/>
|
---|
[4166] | 291 | <compilerarg value="-Xlint:unchecked"/>
|
---|
[7367] | 292 | <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
|
---|
[7351] | 293 | <compilerarg value="-XDignore.symbol.file"/>
|
---|
[10704] | 294 | <compilerarg value="-Xep:ReferenceEquality:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
|
---|
[10659] | 295 | <compilerarg line="-Xmaxwarns 1000"/>
|
---|
[4166] | 296 | </javac>
|
---|
[8526] | 297 | <!-- JOSM -->
|
---|
[10628] | 298 | <javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}"
|
---|
[10912] | 299 | excludes="com/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/**"
|
---|
[10580] | 300 | destdir="build" target="1.8" source="1.8" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8">
|
---|
[10581] | 301 | <compilerclasspath>
|
---|
| 302 | <pathelement location="${error_prone_ant.jar}"/>
|
---|
| 303 | </compilerclasspath>
|
---|
[8526] | 304 | <compilerarg value="-Xlint:cast"/>
|
---|
| 305 | <compilerarg value="-Xlint:deprecation"/>
|
---|
| 306 | <compilerarg value="-Xlint:dep-ann"/>
|
---|
| 307 | <compilerarg value="-Xlint:divzero"/>
|
---|
| 308 | <compilerarg value="-Xlint:empty"/>
|
---|
| 309 | <compilerarg value="-Xlint:finally"/>
|
---|
| 310 | <compilerarg value="-Xlint:overrides"/>
|
---|
| 311 | <!--<compilerarg value="-Xlint:rawtypes"/>-->
|
---|
| 312 | <compilerarg value="-Xlint:static"/>
|
---|
| 313 | <compilerarg value="-Xlint:try"/>
|
---|
| 314 | <compilerarg value="-Xlint:unchecked"/>
|
---|
| 315 | <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
|
---|
| 316 | <compilerarg value="-XDignore.symbol.file"/>
|
---|
[10704] | 317 | <compilerarg value="-Xep:ReferenceEquality:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
|
---|
[11494] | 318 | <compilerarg value="-Xep:ImmutableEnumChecker:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
|
---|
[11675] | 319 | <compilerarg value="-Xep:FutureReturnValueIgnored:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
|
---|
| 320 | <compilerarg value="-Xep:FloatingPointLiteralPrecision:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
|
---|
| 321 | <compilerarg value="-Xep:ShortCircuitBoolean:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/>
|
---|
[10659] | 322 | <compilerarg line="-Xmaxwarns 1000"/>
|
---|
[8526] | 323 | </javac>
|
---|
| 324 |
|
---|
[6756] | 325 | <copy todir="build" failonerror="no" includeemptydirs="no">
|
---|
| 326 | <fileset dir="resources"/>
|
---|
| 327 | </copy>
|
---|
[4166] | 328 | </target>
|
---|
[9765] | 329 | <target name="init" depends="init-properties">
|
---|
[5392] | 330 | <uptodate property="javacc.notRequired" targetfile="${mapcss.dir}/parsergen/MapCSSParser.java" >
|
---|
| 331 | <srcfiles dir="${mapcss.dir}" includes="MapCSSParser.jj"/>
|
---|
| 332 | </uptodate>
|
---|
[9765] | 333 | <mkdir dir="${build.dir}"/>
|
---|
| 334 | <mkdir dir="${dist.dir}"/>
|
---|
[4166] | 335 | </target>
|
---|
[9765] | 336 | <target name="javadoc" depends="init-properties">
|
---|
| 337 | <javadoc destdir="javadoc"
|
---|
[7133] | 338 | sourcepath="${src.dir}"
|
---|
[9765] | 339 | encoding="UTF-8"
|
---|
[5263] | 340 | packagenames="org.openstreetmap.josm.*,org.openstreetmap.gui.jmapviewer.*"
|
---|
[9250] | 341 | excludepackagenames="org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.*"
|
---|
[5263] | 342 | windowtitle="JOSM"
|
---|
| 343 | use="true"
|
---|
[5481] | 344 | private="true"
|
---|
[5263] | 345 | linksource="true"
|
---|
| 346 | author="false">
|
---|
[10580] | 347 | <link href="http://docs.oracle.com/javase/8/docs/api"/>
|
---|
[5263] | 348 | <doctitle><![CDATA[<h2>JOSM - Javadoc</h2>]]></doctitle>
|
---|
[6955] | 349 | <bottom><![CDATA[<a href="https://josm.openstreetmap.de/">JOSM</a>]]></bottom>
|
---|
[11596] | 350 | <arg value="--add-exports" if:set="isJava9" />
|
---|
| 351 | <arg value="java.base/sun.security.util=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 352 | <arg value="--add-exports" if:set="isJava9" />
|
---|
| 353 | <arg value="java.base/sun.security.x509=ALL-UNNAMED" if:set="isJava9" />
|
---|
[5263] | 354 | </javadoc>
|
---|
| 355 | </target>
|
---|
[9765] | 356 | <target name="clean" depends="init-properties">
|
---|
| 357 | <delete dir="${build.dir}"/>
|
---|
| 358 | <delete dir="${proj-build.dir}"/>
|
---|
| 359 | <delete dir="${dist.dir}"/>
|
---|
[4252] | 360 | <delete dir="${mapcss.dir}/parsergen"/>
|
---|
[8535] | 361 | <delete file="${src.dir}/org/w3/_2001/xmlschema/Adapter1.java"/>
|
---|
| 362 | <delete dir="${src.dir}/org/openstreetmap/josm/data/imagery/types"/>
|
---|
[9133] | 363 | <delete file="${epsg.output}"/>
|
---|
[4166] | 364 | </target>
|
---|
[7068] | 365 | <macrodef name="init-test-preferences">
|
---|
| 366 | <attribute name="testfamily"/>
|
---|
| 367 | <sequential>
|
---|
| 368 | <copy file="${test.dir}/config/preferences.template.xml" tofile="${test.dir}/config/@{testfamily}-josm.home/preferences.xml"/>
|
---|
| 369 | <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/>
|
---|
| 370 | <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/>
|
---|
| 371 | </sequential>
|
---|
| 372 | </macrodef>
|
---|
[9765] | 373 | <target name="test-init" depends="init-properties">
|
---|
[6121] | 374 | <mkdir dir="${test.dir}/build"/>
|
---|
[7068] | 375 | <mkdir dir="${test.dir}/build/unit"/>
|
---|
| 376 | <mkdir dir="${test.dir}/build/functional"/>
|
---|
| 377 | <mkdir dir="${test.dir}/build/performance"/>
|
---|
[4166] | 378 | <mkdir dir="${test.dir}/report"/>
|
---|
[7068] | 379 | <init-test-preferences testfamily="unit"/>
|
---|
| 380 | <init-test-preferences testfamily="functional"/>
|
---|
| 381 | <init-test-preferences testfamily="performance"/>
|
---|
[9501] | 382 | <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="tools/jacocoant.jar" />
|
---|
[4166] | 383 | </target>
|
---|
[9765] | 384 | <target name="test-clean" depends="init-properties">
|
---|
[6121] | 385 | <delete dir="${test.dir}/build"/>
|
---|
[4166] | 386 | <delete dir="${test.dir}/report"/>
|
---|
[6133] | 387 | <delete file="${test.dir}/jacoco.exec" />
|
---|
[9501] | 388 | <delete file="${test.dir}/jacocoIT.exec" />
|
---|
[10850] | 389 | <delete file="${test.dir}/config/unit-josm.home" failonerror="false"/>
|
---|
| 390 | <delete file="${test.dir}/config/functional-josm.home" failonerror="false"/>
|
---|
| 391 | <delete file="${test.dir}/config/performance-josm.home" failonerror="false"/>
|
---|
[4166] | 392 | </target>
|
---|
[7068] | 393 | <macrodef name="call-groovyc">
|
---|
| 394 | <attribute name="testfamily"/>
|
---|
| 395 | <element name="cp-elements"/>
|
---|
| 396 | <sequential>
|
---|
| 397 | <groovyc srcdir="${test.dir}/@{testfamily}" destdir="${test.dir}/build/@{testfamily}" encoding="UTF-8">
|
---|
| 398 | <classpath>
|
---|
| 399 | <cp-elements/>
|
---|
| 400 | </classpath>
|
---|
[10580] | 401 | <javac target="1.8" source="1.8" debug="on" encoding="UTF-8">
|
---|
[7068] | 402 | <compilerarg value="-Xlint:all"/>
|
---|
| 403 | <compilerarg value="-Xlint:-serial"/>
|
---|
| 404 | </javac>
|
---|
| 405 | </groovyc>
|
---|
| 406 | </sequential>
|
---|
| 407 | </macrodef>
|
---|
[4166] | 408 | <target name="test-compile" depends="test-init,dist">
|
---|
[8687] | 409 | <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="${groovy.jar}"/>
|
---|
[7068] | 410 | <call-groovyc testfamily="unit">
|
---|
| 411 | <cp-elements>
|
---|
| 412 | <path refid="test.classpath"/>
|
---|
| 413 | </cp-elements>
|
---|
| 414 | </call-groovyc>
|
---|
| 415 | <call-groovyc testfamily="functional">
|
---|
| 416 | <cp-elements>
|
---|
| 417 | <path refid="test.classpath"/>
|
---|
| 418 | <pathelement path="${test.dir}/build/unit"/>
|
---|
| 419 | </cp-elements>
|
---|
| 420 | </call-groovyc>
|
---|
| 421 | <call-groovyc testfamily="performance">
|
---|
| 422 | <cp-elements>
|
---|
| 423 | <path refid="test.classpath"/>
|
---|
| 424 | <pathelement path="${test.dir}/build/unit"/>
|
---|
| 425 | </cp-elements>
|
---|
| 426 | </call-groovyc>
|
---|
[4166] | 427 | </target>
|
---|
[7068] | 428 | <macrodef name="call-junit">
|
---|
| 429 | <attribute name="testfamily"/>
|
---|
[9501] | 430 | <attribute name="testITsuffix" default=""/>
|
---|
[10431] | 431 | <attribute name="coverage" default="true"/>
|
---|
[7068] | 432 | <sequential>
|
---|
[9501] | 433 | <echo message="Running @{testfamily}@{testITsuffix} tests with JUnit"/>
|
---|
[10546] | 434 | <jacoco:coverage destfile="${test.dir}/jacoco@{testITsuffix}.exec" enabled="@{coverage}" excludes="jdk.dynalink.*:jdk.nashorn.*">
|
---|
[7068] | 435 | <junit printsummary="yes" fork="true" forkmode="once">
|
---|
[7367] | 436 | <jvmarg value="-Dfile.encoding=UTF-8"/>
|
---|
[11006] | 437 | <jvmarg value="--add-exports" if:set="isJava9" />
|
---|
| 438 | <jvmarg value="java.base/sun.security.util=ALL-UNNAMED" if:set="isJava9" />
|
---|
| 439 | <jvmarg value="--add-exports" if:set="isJava9" />
|
---|
| 440 | <jvmarg value="java.base/sun.security.x509=ALL-UNNAMED" if:set="isJava9" />
|
---|
[7068] | 441 | <sysproperty key="josm.home" value="${test.dir}/config/@{testfamily}-josm.home"/>
|
---|
| 442 | <sysproperty key="josm.test.data" value="${test.dir}/data"/>
|
---|
| 443 | <sysproperty key="java.awt.headless" value="true"/>
|
---|
[10529] | 444 | <sysproperty key="glass.platform" value="Monocle"/>
|
---|
| 445 | <sysproperty key="monocle.platform" value="Headless"/>
|
---|
| 446 | <sysproperty key="prism.order" value="sw"/>
|
---|
[7068] | 447 | <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
|
---|
| 448 | <classpath>
|
---|
| 449 | <path refid="test.classpath"/>
|
---|
| 450 | <pathelement path="${test.dir}/build/unit"/>
|
---|
| 451 | <pathelement path="${test.dir}/build/@{testfamily}"/>
|
---|
| 452 | <pathelement path="${test.dir}/config"/>
|
---|
| 453 | </classpath>
|
---|
| 454 | <formatter type="plain"/>
|
---|
| 455 | <formatter type="xml"/>
|
---|
| 456 | <batchtest fork="yes" todir="${test.dir}/report">
|
---|
[9501] | 457 | <fileset dir="${test.dir}/build/@{testfamily}" includes="**/*Test@{testITsuffix}.class"/>
|
---|
[7068] | 458 | </batchtest>
|
---|
| 459 | </junit>
|
---|
| 460 | </jacoco:coverage>
|
---|
| 461 | </sequential>
|
---|
| 462 | </macrodef>
|
---|
[9501] | 463 | <target name="test" depends="test-compile" unless="test.notRequired"
|
---|
[7133] | 464 | description="Run unit, functional and performance tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
|
---|
[7068] | 465 | <call-junit testfamily="unit"/>
|
---|
| 466 | <call-junit testfamily="functional"/>
|
---|
[10431] | 467 | <call-junit testfamily="performance" coverage="false"/>
|
---|
[4166] | 468 | </target>
|
---|
[9501] | 469 | <target name="test-it" depends="test-compile" unless="test-it.notRequired"
|
---|
| 470 | description="Run integration tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
|
---|
| 471 | <call-junit testfamily="unit" testITsuffix="IT"/>
|
---|
| 472 | <call-junit testfamily="functional" testITsuffix="IT"/>
|
---|
[10431] | 473 | <call-junit testfamily="performance" testITsuffix="IT" coverage="false"/>
|
---|
[9501] | 474 | </target>
|
---|
| 475 | <target name="test-html" depends="test, test-it" description="Generate HTML test reports">
|
---|
[4166] | 476 | <!-- May require additional ant dependencies like ant-trax package -->
|
---|
| 477 | <junitreport todir="${test.dir}/report">
|
---|
| 478 | <fileset dir="${test.dir}/report">
|
---|
| 479 | <include name="TEST-*.xml"/>
|
---|
| 480 | </fileset>
|
---|
| 481 | <report todir="${test.dir}/report/html"/>
|
---|
| 482 | </junitreport>
|
---|
[6133] | 483 | <jacoco:report>
|
---|
| 484 | <executiondata>
|
---|
[11963] | 485 | <fileset dir="${test.dir}" includes="*.exec"/>
|
---|
[6133] | 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>
|
---|
[6134] | 495 | <html destdir="${test.dir}/report/jacoco"/>
|
---|
[6133] | 496 | </jacoco:report>
|
---|
[4166] | 497 | </target>
|
---|
[8778] | 498 | <!-- Proguard does not support Java 9 : http://sourceforge.net/p/proguard/bugs/551/ -->
|
---|
| 499 | <target name="dist-optimized" depends="dist" unless="isJava9">
|
---|
[4166] | 500 | <taskdef resource="proguard/ant/task.properties" classpath="tools/proguard.jar"/>
|
---|
| 501 | <proguard>
|
---|
[7367] | 502 | -injars dist/josm-custom.jar
|
---|
| 503 | -outjars dist/josm-custom-optimized.jar
|
---|
[4166] | 504 |
|
---|
[7367] | 505 | -libraryjars ${java.home}/lib/rt.jar
|
---|
| 506 | -libraryjars ${java.home}/lib/jce.jar
|
---|
[4166] | 507 |
|
---|
[7367] | 508 | -dontoptimize
|
---|
| 509 | -dontobfuscate
|
---|
[4166] | 510 |
|
---|
[7367] | 511 | # These options probably are not necessary (and make processing a bit slower)
|
---|
| 512 | -dontskipnonpubliclibraryclasses
|
---|
| 513 | -dontskipnonpubliclibraryclassmembers
|
---|
[4166] | 514 |
|
---|
[7367] | 515 | -keepclasseswithmembers public class org.openstreetmap.josm.gui.MainApplication {
|
---|
| 516 | public static void main(java.lang.String[]);
|
---|
| 517 | }
|
---|
[4166] | 518 |
|
---|
[7367] | 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
|
---|
[10949] | 522 | -keep class org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory$PseudoClasses {
|
---|
[8532] | 523 | static boolean *(org.openstreetmap.josm.gui.mappaint.Environment);
|
---|
| 524 | }
|
---|
[8172] | 525 | -keep class org.apache.commons.logging.impl.*
|
---|
[4166] | 526 |
|
---|
[7367] | 527 | -keepclassmembers enum * {
|
---|
| 528 | public static **[] values();
|
---|
| 529 | public static ** valueOf(java.lang.String);
|
---|
| 530 | }
|
---|
[4166] | 531 |
|
---|
[7367] | 532 | # Keep unused public methods (can be useful for plugins)
|
---|
| 533 | -keepclassmembers class * {
|
---|
| 534 | public protected *;
|
---|
| 535 | }
|
---|
[4838] | 536 |
|
---|
[10949] | 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 |
|
---|
[7367] | 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
|
---|
[6133] | 546 | </proguard>
|
---|
[4166] | 547 | </target>
|
---|
[10845] | 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>
|
---|
[4166] | 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">
|
---|
[11019] | 568 | <classpath path="tools/animal-sniffer-ant-tasks-1.15.jar"/>
|
---|
[4166] | 569 | </typedef>
|
---|
| 570 | <mkdir dir="${dir}"/>
|
---|
| 571 | <!-- List of deprecated plugins -->
|
---|
[7133] | 572 | <loadfile property="deprecated-plugins" srcFile="${src.dir}/org/openstreetmap/josm/plugins/PluginHandler.java">
|
---|
[4166] | 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>
|
---|
[5498] | 586 | <!-- Download list of plugins -->
|
---|
[4166] | 587 | <loadresource property="plugins">
|
---|
[6955] | 588 | <url url="https://josm.openstreetmap.de/plugin"/>
|
---|
[4166] | 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>
|
---|
[6133] | 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"/>
|
---|
[9765] | 611 | </tokenfilter>
|
---|
[6133] | 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 -->
|
---|
[4166] | 623 | <copy todir="${dir}" flatten="true">
|
---|
| 624 | <resourcelist>
|
---|
| 625 | <string value="${plugins}"/>
|
---|
| 626 | </resourcelist>
|
---|
| 627 | </copy>
|
---|
| 628 | <!-- Check plugins -->
|
---|
[5498] | 629 | <as:build-signatures destfile="${dir}/api.sig">
|
---|
| 630 | <path>
|
---|
[9765] | 631 | <fileset file="${dist.dir}/josm-custom-optimized.jar"/>
|
---|
[5498] | 632 | <fileset file="${java.home}/lib/rt.jar"/>
|
---|
| 633 | <fileset file="${java.home}/lib/jce.jar"/>
|
---|
| 634 | </path>
|
---|
[6133] | 635 | </as:build-signatures>
|
---|
[4166] | 636 | <as:check-signature signature="${dir}/api.sig">
|
---|
[7367] | 637 | <ignore classname="au.edu.*"/>
|
---|
| 638 | <ignore classname="au.com.*"/>
|
---|
| 639 | <ignore classname="com.*"/>
|
---|
[7934] | 640 | <ignore classname="de.miethxml.*"/>
|
---|
[8090] | 641 | <ignore classname="javafx.*"/>
|
---|
[7367] | 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.*"/>
|
---|
[7934] | 652 | <ignore classname="org.iso_relax.*"/>
|
---|
[7367] | 653 | <ignore classname="org.jaitools.*"/>
|
---|
| 654 | <ignore classname="org.jaxen.*"/>
|
---|
| 655 | <ignore classname="org.jdom2.*"/>
|
---|
[4166] | 656 | <ignore classname="org.jgraph.*"/>
|
---|
[7367] | 657 | <ignore classname="org.joda.time.*"/>
|
---|
[4166] | 658 | <ignore classname="org.jvnet.staxex.*"/>
|
---|
[7367] | 659 | <ignore classname="org.kxml2.*"/>
|
---|
[8090] | 660 | <ignore classname="org.objectweb.*"/>
|
---|
[7367] | 661 | <ignore classname="org.python.*"/>
|
---|
| 662 | <ignore classname="org.slf4j.*"/>
|
---|
[8173] | 663 | <!-- plugins used by another ones -->
|
---|
[7494] | 664 | <ignore classname="org.openstreetmap.josm.plugins.geotools.*"/>
|
---|
[7934] | 665 | <ignore classname="org.openstreetmap.josm.plugins.jna.*"/>
|
---|
[7494] | 666 | <ignore classname="org.openstreetmap.josm.plugins.jts.*"/>
|
---|
| 667 | <ignore classname="org.openstreetmap.josm.plugins.log4j.*"/>
|
---|
| 668 | <ignore classname="org.openstreetmap.josm.plugins.utilsplugin2.*"/>
|
---|
[4166] | 669 | <path path="${dir}"/>
|
---|
| 670 | </as:check-signature>
|
---|
| 671 | </target>
|
---|
[4838] | 672 |
|
---|
[8687] | 673 | <macrodef name="_taginfo">
|
---|
| 674 | <attribute name="type"/>
|
---|
| 675 | <attribute name="output"/>
|
---|
| 676 | <sequential>
|
---|
| 677 | <echo message="Generating Taginfo for type @{type} to @{output}"/>
|
---|
[11324] | 678 | <groovy src="${taginfoextract}" classpath="${dist.dir}/josm-custom.jar:tools/findbugs/annotations.jar">
|
---|
[8687] | 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"/>
|
---|
[9880] | 693 | <property name="taginfoextract" value="scripts/TagInfoExtract.groovy"/>
|
---|
[8687] | 694 | <property name="imgurlprefix" value="http://josm.openstreetmap.de/download/taginfo/taginfo-img"/>
|
---|
[9250] | 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"/>
|
---|
[8687] | 698 | </target>
|
---|
| 699 |
|
---|
[9765] | 700 | <target name="imageryindex" depends="init-properties">
|
---|
[9505] | 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"/>
|
---|
[11582] | 703 | <groovy src="scripts/SyncEditorLayerIndex.groovy" classpath="${dist.dir}/josm-custom.jar">
|
---|
[11965] | 704 | <arg value="-noeli"/>
|
---|
[11964] | 705 | <arg value="-p"/>
|
---|
[11965] | 706 | <arg value="imagery_eliout.imagery.xml"/>
|
---|
[11964] | 707 | <arg value="-q"/>
|
---|
[11965] | 708 | <arg value="imagery_josmout.imagery.xml"/>
|
---|
[9505] | 709 | </groovy>
|
---|
| 710 | </target>
|
---|
| 711 |
|
---|
| 712 | <target name="imageryindexdownload">
|
---|
| 713 | <exec append="false" executable="wget" failifexecutionfails="true">
|
---|
| 714 | <arg value="https://josm.openstreetmap.de/maps"/>
|
---|
| 715 | <arg value="-O"/>
|
---|
[11965] | 716 | <arg value="imagery_josm.imagery.xml"/>
|
---|
[9505] | 717 | <arg value="--unlink"/>
|
---|
| 718 | </exec>
|
---|
| 719 | <exec append="false" executable="wget" failifexecutionfails="true">
|
---|
[11238] | 720 | <arg value="https://josm.openstreetmap.de/wiki/ImageryCompareIgnores?format=txt"/>
|
---|
| 721 | <arg value="-O"/>
|
---|
[11965] | 722 | <arg value="imagery_josm.ignores.txt"/>
|
---|
[11238] | 723 | <arg value="--unlink"/>
|
---|
| 724 | </exec>
|
---|
| 725 | <exec append="false" executable="wget" failifexecutionfails="true">
|
---|
[11857] | 726 | <arg value="https://raw.githubusercontent.com/osmlab/editor-layer-index/gh-pages/imagery.geojson"/>
|
---|
[9505] | 727 | <arg value="-O"/>
|
---|
[11965] | 728 | <arg value="imagery_eli.geojson"/>
|
---|
[9505] | 729 | <arg value="--unlink"/>
|
---|
| 730 | </exec>
|
---|
| 731 | <antcall target="imageryindex"/>
|
---|
| 732 | </target>
|
---|
| 733 |
|
---|
[9765] | 734 | <target name="checkstyle" depends="init-properties">
|
---|
| 735 | <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties"
|
---|
[11524] | 736 | classpath="tools/checkstyle/checkstyle-all.jar"/>
|
---|
[8508] | 737 | <checkstyle config="tools/checkstyle/josm_checks.xml">
|
---|
[9765] | 738 | <fileset dir="${base.dir}/src/org/openstreetmap/josm" includes="**/*.java"
|
---|
[9250] | 739 | excludes="gui/mappaint/mapcss/parsergen/*.java"/>
|
---|
[9765] | 740 | <fileset dir="${base.dir}/test" includes="**/*.java"/>
|
---|
[11681] | 741 | <formatter type="plain"/>
|
---|
[8508] | 742 | <formatter type="xml" toFile="checkstyle-josm.xml"/>
|
---|
| 743 | </checkstyle>
|
---|
| 744 | </target>
|
---|
| 745 |
|
---|
[4838] | 746 | <target name="findbugs" depends="dist">
|
---|
[6133] | 747 | <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="tools/findbugs/findbugs-ant.jar"/>
|
---|
[4838] | 748 | <path id="findbugs-classpath">
|
---|
[9765] | 749 | <fileset dir="${base.dir}/tools/findbugs/">
|
---|
[4838] | 750 | <include name="*.jar"/>
|
---|
| 751 | </fileset>
|
---|
| 752 | </path>
|
---|
[6133] | 753 | <property name="findbugs-classpath" refid="findbugs-classpath"/>
|
---|
| 754 | <findbugs output="xml"
|
---|
[4838] | 755 | outputFile="findbugs-josm.xml"
|
---|
[6133] | 756 | classpath="${findbugs-classpath}"
|
---|
| 757 | pluginList=""
|
---|
| 758 | excludeFilter="tools/findbugs/josm-filter.xml"
|
---|
| 759 | effort="max"
|
---|
[10223] | 760 | reportLevel="low"
|
---|
[6133] | 761 | >
|
---|
[9765] | 762 | <sourcePath path="${base.dir}/src" />
|
---|
| 763 | <class location="${dist.dir}/josm-custom.jar" />
|
---|
[6133] | 764 | </findbugs>
|
---|
[4838] | 765 | </target>
|
---|
[11713] | 766 |
|
---|
| 767 | <target name="pmd" depends="init-properties">
|
---|
| 768 | <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpath="${toString:pmd.classpath}"/>
|
---|
| 769 | <pmd shortFilenames="true" encoding="UTF-8">
|
---|
| 770 | <sourceLanguage name="java" version="1.8" />
|
---|
| 771 | <ruleset>${base.dir}/tools/pmd/josm-ruleset.xml</ruleset>
|
---|
| 772 | <formatter type="text" toConsole="true" />
|
---|
| 773 | <formatter type="xml" toFile="pmd-josm.xml">
|
---|
| 774 | <param name="encoding" value="UTF-8" />
|
---|
| 775 | </formatter>
|
---|
| 776 | <fileset dir="${src.dir}">
|
---|
| 777 | <include name="org/openstreetmap/josm/**/*.java"/>
|
---|
| 778 | <exclude name="org/openstreetmap/josm/gui/mappaint/mapcss/parsergen/*.java" />
|
---|
| 779 | </fileset>
|
---|
| 780 | </pmd>
|
---|
| 781 | </target>
|
---|
| 782 |
|
---|
[5323] | 783 | <target name="run" depends="dist">
|
---|
[9765] | 784 | <java jar="${dist.dir}/josm-custom.jar" fork="true">
|
---|
[5323] | 785 | <arg value="--set=expert=true"/>
|
---|
| 786 | <arg value="--set=remotecontrol.enabled=true"/>
|
---|
| 787 | <arg value="--set=debug.edt-checker.enable=false"/>
|
---|
| 788 | <jvmarg value="-Djosm.home=/tmp/.josm/"/>
|
---|
| 789 | </java>
|
---|
| 790 | </target>
|
---|
[9765] | 791 | <!--
|
---|
| 792 | ** Compile build script for generating projection list.
|
---|
| 793 | -->
|
---|
[10850] | 794 | <target name="epsg-compile" depends="init-properties">
|
---|
[9765] | 795 | <property name="proj-classpath" location="${build.dir}"/>
|
---|
| 796 | <mkdir dir="${proj-build.dir}"/>
|
---|
| 797 | <javac sourcepath="" srcdir="${base.dir}/scripts" failonerror="true"
|
---|
[10580] | 798 | destdir="${proj-build.dir}" target="1.8" source="1.8" debug="on"
|
---|
[9765] | 799 | includeantruntime="false" createMissingPackageInfoClass="false"
|
---|
| 800 | encoding="UTF-8" classpath="${proj-classpath}">
|
---|
[9133] | 801 | </javac>
|
---|
| 802 | </target>
|
---|
[9765] | 803 | <!--
|
---|
| 804 | ** generate projection list.
|
---|
| 805 | -->
|
---|
[9133] | 806 | <target name="epsg" depends="epsg-compile">
|
---|
| 807 | <touch file="${epsg.output}"/>
|
---|
[10259] | 808 | <java classname="BuildProjectionDefinitions" failonerror="true" fork="true">
|
---|
[9735] | 809 | <sysproperty key="java.awt.headless" value="true"/>
|
---|
[9133] | 810 | <classpath>
|
---|
[9765] | 811 | <pathelement path="${base.dir}"/>
|
---|
| 812 | <pathelement path="${proj-classpath}"/>
|
---|
| 813 | <pathelement path="${proj-build.dir}"/>
|
---|
[9133] | 814 | </classpath>
|
---|
[9765] | 815 | <arg value="${base.dir}"/>
|
---|
[9133] | 816 | </java>
|
---|
| 817 | </target>
|
---|
[4166] | 818 | </project>
|
---|