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