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