[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}"/> |
---|
| 50 | <pathelement path="tools/findbugs/annotations.jar"/> |
---|
| 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 --> |
---|
[8173] | 234 | <javac srcdir="${src.dir}" includes="com/**,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}" |
---|
[11926] | 288 | 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/**" |
---|
[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"/> |
---|
[4166] | 308 | </javac> |
---|
[12648] | 309 | </target> |
---|
| 310 | <target name="compile" depends="init,javacc,compile-cots,compile-jmapviewer"> |
---|
[8526] | 311 | <!-- JOSM --> |
---|
[12582] | 312 | <javac compiler="${javac.compiler}" sourcepath="" srcdir="${src.dir}" |
---|
[10912] | 313 | excludes="com/**,oauth/**,org/apache/commons/**,org/glassfish/**,org/openstreetmap/gui/jmapviewer/**" |
---|
[12648] | 314 | destdir="${build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8"> |
---|
[10581] | 315 | <compilerclasspath> |
---|
| 316 | <pathelement location="${error_prone_ant.jar}"/> |
---|
| 317 | </compilerclasspath> |
---|
[8526] | 318 | <compilerarg value="-Xlint:cast"/> |
---|
| 319 | <compilerarg value="-Xlint:deprecation"/> |
---|
| 320 | <compilerarg value="-Xlint:dep-ann"/> |
---|
| 321 | <compilerarg value="-Xlint:divzero"/> |
---|
| 322 | <compilerarg value="-Xlint:empty"/> |
---|
| 323 | <compilerarg value="-Xlint:finally"/> |
---|
| 324 | <compilerarg value="-Xlint:overrides"/> |
---|
| 325 | <!--<compilerarg value="-Xlint:rawtypes"/>--> |
---|
| 326 | <compilerarg value="-Xlint:static"/> |
---|
| 327 | <compilerarg value="-Xlint:try"/> |
---|
| 328 | <compilerarg value="-Xlint:unchecked"/> |
---|
| 329 | <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 --> |
---|
| 330 | <compilerarg value="-XDignore.symbol.file"/> |
---|
[10704] | 331 | <compilerarg value="-Xep:ReferenceEquality:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/> |
---|
[11494] | 332 | <compilerarg value="-Xep:ImmutableEnumChecker:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/> |
---|
[11675] | 333 | <compilerarg value="-Xep:FutureReturnValueIgnored:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/> |
---|
| 334 | <compilerarg value="-Xep:FloatingPointLiteralPrecision:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/> |
---|
| 335 | <compilerarg value="-Xep:ShortCircuitBoolean:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/> |
---|
[12243] | 336 | <compilerarg value="-Xep:LiteralClassName:OFF" compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"/> |
---|
[10659] | 337 | <compilerarg line="-Xmaxwarns 1000"/> |
---|
[8526] | 338 | </javac> |
---|
| 339 | |
---|
[6756] | 340 | <copy todir="build" failonerror="no" includeemptydirs="no"> |
---|
| 341 | <fileset dir="resources"/> |
---|
| 342 | </copy> |
---|
[4166] | 343 | </target> |
---|
[9765] | 344 | <target name="init" depends="init-properties"> |
---|
[5392] | 345 | <uptodate property="javacc.notRequired" targetfile="${mapcss.dir}/parsergen/MapCSSParser.java" > |
---|
| 346 | <srcfiles dir="${mapcss.dir}" includes="MapCSSParser.jj"/> |
---|
| 347 | </uptodate> |
---|
[9765] | 348 | <mkdir dir="${build.dir}"/> |
---|
| 349 | <mkdir dir="${dist.dir}"/> |
---|
[4166] | 350 | </target> |
---|
[9765] | 351 | <target name="javadoc" depends="init-properties"> |
---|
| 352 | <javadoc destdir="javadoc" |
---|
[7133] | 353 | sourcepath="${src.dir}" |
---|
[9765] | 354 | encoding="UTF-8" |
---|
[5263] | 355 | packagenames="org.openstreetmap.josm.*,org.openstreetmap.gui.jmapviewer.*" |
---|
[9250] | 356 | excludepackagenames="org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.*" |
---|
[5263] | 357 | windowtitle="JOSM" |
---|
| 358 | use="true" |
---|
[5481] | 359 | private="true" |
---|
[5263] | 360 | linksource="true" |
---|
| 361 | author="false"> |
---|
[10580] | 362 | <link href="http://docs.oracle.com/javase/8/docs/api"/> |
---|
[5263] | 363 | <doctitle><![CDATA[<h2>JOSM - Javadoc</h2>]]></doctitle> |
---|
[6955] | 364 | <bottom><![CDATA[<a href="https://josm.openstreetmap.de/">JOSM</a>]]></bottom> |
---|
[11596] | 365 | <arg value="--add-exports" if:set="isJava9" /> |
---|
| 366 | <arg value="java.base/sun.security.util=ALL-UNNAMED" if:set="isJava9" /> |
---|
| 367 | <arg value="--add-exports" if:set="isJava9" /> |
---|
| 368 | <arg value="java.base/sun.security.x509=ALL-UNNAMED" if:set="isJava9" /> |
---|
[12406] | 369 | <arg value="--add-exports" if:set="isJava9" /> |
---|
| 370 | <arg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" if:set="isJava9" /> |
---|
[5263] | 371 | </javadoc> |
---|
| 372 | </target> |
---|
[9765] | 373 | <target name="clean" depends="init-properties"> |
---|
| 374 | <delete dir="${build.dir}"/> |
---|
| 375 | <delete dir="${proj-build.dir}"/> |
---|
[12582] | 376 | <delete dir="${checkstyle-build.dir}"/> |
---|
[9765] | 377 | <delete dir="${dist.dir}"/> |
---|
[4252] | 378 | <delete dir="${mapcss.dir}/parsergen"/> |
---|
[8535] | 379 | <delete file="${src.dir}/org/w3/_2001/xmlschema/Adapter1.java"/> |
---|
| 380 | <delete dir="${src.dir}/org/openstreetmap/josm/data/imagery/types"/> |
---|
[9133] | 381 | <delete file="${epsg.output}"/> |
---|
[4166] | 382 | </target> |
---|
[7068] | 383 | <macrodef name="init-test-preferences"> |
---|
| 384 | <attribute name="testfamily"/> |
---|
| 385 | <sequential> |
---|
| 386 | <copy file="${test.dir}/config/preferences.template.xml" tofile="${test.dir}/config/@{testfamily}-josm.home/preferences.xml"/> |
---|
| 387 | <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/> |
---|
| 388 | <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/> |
---|
| 389 | </sequential> |
---|
| 390 | </macrodef> |
---|
[9765] | 391 | <target name="test-init" depends="init-properties"> |
---|
[6121] | 392 | <mkdir dir="${test.dir}/build"/> |
---|
[7068] | 393 | <mkdir dir="${test.dir}/build/unit"/> |
---|
| 394 | <mkdir dir="${test.dir}/build/functional"/> |
---|
| 395 | <mkdir dir="${test.dir}/build/performance"/> |
---|
[4166] | 396 | <mkdir dir="${test.dir}/report"/> |
---|
[7068] | 397 | <init-test-preferences testfamily="unit"/> |
---|
| 398 | <init-test-preferences testfamily="functional"/> |
---|
| 399 | <init-test-preferences testfamily="performance"/> |
---|
[9501] | 400 | <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="tools/jacocoant.jar" /> |
---|
[4166] | 401 | </target> |
---|
[9765] | 402 | <target name="test-clean" depends="init-properties"> |
---|
[6121] | 403 | <delete dir="${test.dir}/build"/> |
---|
[4166] | 404 | <delete dir="${test.dir}/report"/> |
---|
[6133] | 405 | <delete file="${test.dir}/jacoco.exec" /> |
---|
[9501] | 406 | <delete file="${test.dir}/jacocoIT.exec" /> |
---|
[10850] | 407 | <delete file="${test.dir}/config/unit-josm.home" failonerror="false"/> |
---|
| 408 | <delete file="${test.dir}/config/functional-josm.home" failonerror="false"/> |
---|
| 409 | <delete file="${test.dir}/config/performance-josm.home" failonerror="false"/> |
---|
[4166] | 410 | </target> |
---|
[7068] | 411 | <macrodef name="call-groovyc"> |
---|
| 412 | <attribute name="testfamily"/> |
---|
| 413 | <element name="cp-elements"/> |
---|
| 414 | <sequential> |
---|
| 415 | <groovyc srcdir="${test.dir}/@{testfamily}" destdir="${test.dir}/build/@{testfamily}" encoding="UTF-8"> |
---|
| 416 | <classpath> |
---|
| 417 | <cp-elements/> |
---|
| 418 | </classpath> |
---|
[12628] | 419 | <javac target="${java.lang.version}" source="${java.lang.version}" debug="on" encoding="UTF-8"> |
---|
[7068] | 420 | <compilerarg value="-Xlint:all"/> |
---|
| 421 | <compilerarg value="-Xlint:-serial"/> |
---|
| 422 | </javac> |
---|
| 423 | </groovyc> |
---|
| 424 | </sequential> |
---|
| 425 | </macrodef> |
---|
[4166] | 426 | <target name="test-compile" depends="test-init,dist"> |
---|
[8687] | 427 | <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="${groovy.jar}"/> |
---|
[7068] | 428 | <call-groovyc testfamily="unit"> |
---|
| 429 | <cp-elements> |
---|
| 430 | <path refid="test.classpath"/> |
---|
| 431 | </cp-elements> |
---|
| 432 | </call-groovyc> |
---|
| 433 | <call-groovyc testfamily="functional"> |
---|
| 434 | <cp-elements> |
---|
| 435 | <path refid="test.classpath"/> |
---|
| 436 | <pathelement path="${test.dir}/build/unit"/> |
---|
| 437 | </cp-elements> |
---|
| 438 | </call-groovyc> |
---|
| 439 | <call-groovyc testfamily="performance"> |
---|
| 440 | <cp-elements> |
---|
| 441 | <path refid="test.classpath"/> |
---|
| 442 | <pathelement path="${test.dir}/build/unit"/> |
---|
| 443 | </cp-elements> |
---|
| 444 | </call-groovyc> |
---|
[4166] | 445 | </target> |
---|
[7068] | 446 | <macrodef name="call-junit"> |
---|
| 447 | <attribute name="testfamily"/> |
---|
[9501] | 448 | <attribute name="testITsuffix" default=""/> |
---|
[10431] | 449 | <attribute name="coverage" default="true"/> |
---|
[7068] | 450 | <sequential> |
---|
[9501] | 451 | <echo message="Running @{testfamily}@{testITsuffix} tests with JUnit"/> |
---|
[12255] | 452 | <jacoco:coverage destfile="${test.dir}/jacoco@{testITsuffix}.exec" enabled="@{coverage}" includes="org.openstreetmap.josm.*"> |
---|
[7068] | 453 | <junit printsummary="yes" fork="true" forkmode="once"> |
---|
[7367] | 454 | <jvmarg value="-Dfile.encoding=UTF-8"/> |
---|
[12237] | 455 | <jvmarg value="--add-modules" if:set="isJava9" /> |
---|
| 456 | <jvmarg value="java.se.ee" if:set="isJava9" /> |
---|
[11006] | 457 | <jvmarg value="--add-exports" if:set="isJava9" /> |
---|
| 458 | <jvmarg value="java.base/sun.security.util=ALL-UNNAMED" if:set="isJava9" /> |
---|
[12459] | 459 | <jvmarg value="--add-exports" if:set="isJava9" /> |
---|
[11006] | 460 | <jvmarg value="java.base/sun.security.x509=ALL-UNNAMED" if:set="isJava9" /> |
---|
[12238] | 461 | <jvmarg value="--add-exports" if:set="isJava9" /> |
---|
[12408] | 462 | <jvmarg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" if:set="isJava9" /> |
---|
| 463 | <jvmarg value="--add-exports" if:set="isJava9" /> |
---|
[12238] | 464 | <jvmarg value="jdk.deploy/com.sun.deploy.config=ALL-UNNAMED" if:set="isJava9" /> |
---|
[12228] | 465 | <jvmarg value="--add-opens" if:set="isJava9" /> |
---|
[12230] | 466 | <jvmarg value="java.base/java.io=ALL-UNNAMED" if:set="isJava9" /> |
---|
| 467 | <jvmarg value="--add-opens" if:set="isJava9" /> |
---|
[12228] | 468 | <jvmarg value="java.base/java.lang=ALL-UNNAMED" if:set="isJava9" /> |
---|
[12230] | 469 | <jvmarg value="--add-opens" if:set="isJava9" /> |
---|
| 470 | <jvmarg value="java.base/java.text=ALL-UNNAMED" if:set="isJava9" /> |
---|
| 471 | <jvmarg value="--add-opens" if:set="isJava9" /> |
---|
| 472 | <jvmarg value="java.base/java.util=ALL-UNNAMED" if:set="isJava9" /> |
---|
| 473 | <jvmarg value="--add-opens" if:set="isJava9" /> |
---|
| 474 | <jvmarg value="java.desktop/java.awt=ALL-UNNAMED" if:set="isJava9" /> |
---|
[7068] | 475 | <sysproperty key="josm.home" value="${test.dir}/config/@{testfamily}-josm.home"/> |
---|
| 476 | <sysproperty key="josm.test.data" value="${test.dir}/data"/> |
---|
| 477 | <sysproperty key="java.awt.headless" value="true"/> |
---|
[10529] | 478 | <sysproperty key="glass.platform" value="Monocle"/> |
---|
| 479 | <sysproperty key="monocle.platform" value="Headless"/> |
---|
| 480 | <sysproperty key="prism.order" value="sw"/> |
---|
[7068] | 481 | <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/> |
---|
| 482 | <classpath> |
---|
| 483 | <path refid="test.classpath"/> |
---|
| 484 | <pathelement path="${test.dir}/build/unit"/> |
---|
| 485 | <pathelement path="${test.dir}/build/@{testfamily}"/> |
---|
| 486 | <pathelement path="${test.dir}/config"/> |
---|
| 487 | </classpath> |
---|
| 488 | <formatter type="plain"/> |
---|
| 489 | <formatter type="xml"/> |
---|
| 490 | <batchtest fork="yes" todir="${test.dir}/report"> |
---|
[9501] | 491 | <fileset dir="${test.dir}/build/@{testfamily}" includes="**/*Test@{testITsuffix}.class"/> |
---|
[7068] | 492 | </batchtest> |
---|
| 493 | </junit> |
---|
| 494 | </jacoco:coverage> |
---|
| 495 | </sequential> |
---|
| 496 | </macrodef> |
---|
[9501] | 497 | <target name="test" depends="test-compile" unless="test.notRequired" |
---|
[12534] | 498 | description="Run unit and functional tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password"> |
---|
[7068] | 499 | <call-junit testfamily="unit"/> |
---|
| 500 | <call-junit testfamily="functional"/> |
---|
[4166] | 501 | </target> |
---|
[9501] | 502 | <target name="test-it" depends="test-compile" unless="test-it.notRequired" |
---|
| 503 | description="Run integration tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password"> |
---|
| 504 | <call-junit testfamily="unit" testITsuffix="IT"/> |
---|
| 505 | <call-junit testfamily="functional" testITsuffix="IT"/> |
---|
| 506 | </target> |
---|
[12534] | 507 | <target name="test-perf" depends="test-compile" unless="test-perf.notRequired" |
---|
| 508 | description="Run performance tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password"> |
---|
| 509 | <call-junit testfamily="performance" coverage="false"/> |
---|
| 510 | </target> |
---|
| 511 | <target name="test-html" depends="test, test-it, test-perf" description="Generate HTML test reports"> |
---|
[4166] | 512 | <!-- May require additional ant dependencies like ant-trax package --> |
---|
| 513 | <junitreport todir="${test.dir}/report"> |
---|
| 514 | <fileset dir="${test.dir}/report"> |
---|
| 515 | <include name="TEST-*.xml"/> |
---|
| 516 | </fileset> |
---|
| 517 | <report todir="${test.dir}/report/html"/> |
---|
| 518 | </junitreport> |
---|
[6133] | 519 | <jacoco:report> |
---|
| 520 | <executiondata> |
---|
[11963] | 521 | <fileset dir="${test.dir}" includes="*.exec"/> |
---|
[6133] | 522 | </executiondata> |
---|
| 523 | <structure name="JOSM Test Coverage"> |
---|
| 524 | <classfiles> |
---|
| 525 | <fileset dir="${build.dir}" includes="org/openstreetmap/"/> |
---|
| 526 | </classfiles> |
---|
| 527 | <sourcefiles encoding="UTF-8"> |
---|
| 528 | <fileset dir="${src.dir}" includes="org/openstreetmap/"/> |
---|
| 529 | </sourcefiles> |
---|
| 530 | </structure> |
---|
[6134] | 531 | <html destdir="${test.dir}/report/jacoco"/> |
---|
[6133] | 532 | </jacoco:report> |
---|
[4166] | 533 | </target> |
---|
[8778] | 534 | <!-- Proguard does not support Java 9 : http://sourceforge.net/p/proguard/bugs/551/ --> |
---|
| 535 | <target name="dist-optimized" depends="dist" unless="isJava9"> |
---|
[4166] | 536 | <taskdef resource="proguard/ant/task.properties" classpath="tools/proguard.jar"/> |
---|
| 537 | <proguard> |
---|
[12628] | 538 | -injars ${dist.jar} |
---|
| 539 | -outjars ${dist-optimized.jar} |
---|
[4166] | 540 | |
---|
[7367] | 541 | -libraryjars ${java.home}/lib/rt.jar |
---|
| 542 | -libraryjars ${java.home}/lib/jce.jar |
---|
[12331] | 543 | -libraryjars ${java.home}/lib/ext/jfxrt.jar |
---|
[4166] | 544 | |
---|
[7367] | 545 | -dontoptimize |
---|
| 546 | -dontobfuscate |
---|
[4166] | 547 | |
---|
[7367] | 548 | # These options probably are not necessary (and make processing a bit slower) |
---|
| 549 | -dontskipnonpubliclibraryclasses |
---|
| 550 | -dontskipnonpubliclibraryclassmembers |
---|
[4166] | 551 | |
---|
[7367] | 552 | -keepclasseswithmembers public class org.openstreetmap.josm.gui.MainApplication { |
---|
| 553 | public static void main(java.lang.String[]); |
---|
| 554 | } |
---|
[4166] | 555 | |
---|
[7367] | 556 | -keep class * extends org.openstreetmap.josm.io.FileImporter |
---|
| 557 | -keep class * extends org.openstreetmap.josm.io.FileExporter |
---|
| 558 | -keep class org.openstreetmap.josm.actions.search.SearchCompiler$Never |
---|
[10949] | 559 | -keep class org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory$PseudoClasses { |
---|
[8532] | 560 | static boolean *(org.openstreetmap.josm.gui.mappaint.Environment); |
---|
| 561 | } |
---|
[8172] | 562 | -keep class org.apache.commons.logging.impl.* |
---|
[4166] | 563 | |
---|
[7367] | 564 | -keepclassmembers enum * { |
---|
| 565 | public static **[] values(); |
---|
| 566 | public static ** valueOf(java.lang.String); |
---|
| 567 | } |
---|
[4166] | 568 | |
---|
[7367] | 569 | # Keep unused public methods (can be useful for plugins) |
---|
| 570 | -keepclassmembers class * { |
---|
| 571 | public protected *; |
---|
| 572 | } |
---|
[4838] | 573 | |
---|
[10949] | 574 | # Keep serialization methods |
---|
| 575 | -keepclassmembers class * implements java.io.Serializable { |
---|
| 576 | private void writeObject(java.io.ObjectOutputStream); |
---|
| 577 | private void readObject(java.io.ObjectInputStream); |
---|
| 578 | } |
---|
| 579 | |
---|
[7367] | 580 | # Disable annoying [proguard] Note: the configuration keeps the entry point '...', but not the descriptor class '...'. |
---|
| 581 | # This note should not be a problem as we don't use obfuscation |
---|
| 582 | -dontnote |
---|
[6133] | 583 | </proguard> |
---|
[4166] | 584 | </target> |
---|
[10845] | 585 | <!-- Proguard does not support Java 9 : http://sourceforge.net/p/proguard/bugs/551/ --> |
---|
| 586 | <target name="dist-optimized-report" depends="dist-optimized" unless="isJava9"> |
---|
| 587 | <!-- generate difference report between optimized jar and normal one --> |
---|
| 588 | <exec executable="perl" dir="${basedir}"> |
---|
| 589 | <arg value="tools/japicc/japi-compliance-checker.pl"/> |
---|
| 590 | <arg value="--lib=JOSM"/> |
---|
| 591 | <arg value="--keep-internal"/> |
---|
| 592 | <arg value="--v1=${version.entry.commit.revision}"/> |
---|
| 593 | <arg value="--v2=${version.entry.commit.revision}-optimized"/> |
---|
| 594 | <arg value="--report-path=${dist.dir}/compat_report.html"/> |
---|
[12628] | 595 | <arg value="${dist.jar}"/> |
---|
| 596 | <arg value="${dist-optimized.jar}"/> |
---|
[10845] | 597 | </exec> |
---|
| 598 | </target> |
---|
[4166] | 599 | <target name="check-plugins" depends="dist-optimized"> |
---|
| 600 | <echo message="Check of plugins binary compatibility (needs ant 1.8)"/> |
---|
| 601 | <local name="dir"/> |
---|
| 602 | <local name="plugins"/> |
---|
| 603 | <property name="dir" value="plugin-check"/> |
---|
| 604 | <typedef uri="antlib:org.codehaus.mojo.animal_sniffer"> |
---|
[11019] | 605 | <classpath path="tools/animal-sniffer-ant-tasks-1.15.jar"/> |
---|
[4166] | 606 | </typedef> |
---|
| 607 | <mkdir dir="${dir}"/> |
---|
| 608 | <!-- List of deprecated plugins --> |
---|
[7133] | 609 | <loadfile property="deprecated-plugins" srcFile="${src.dir}/org/openstreetmap/josm/plugins/PluginHandler.java"> |
---|
[4166] | 610 | <filterchain> |
---|
| 611 | <linecontains> |
---|
| 612 | <contains value="new DeprecatedPlugin("/> |
---|
| 613 | </linecontains> |
---|
| 614 | <tokenfilter> |
---|
| 615 | <replaceregex pattern=".*new DeprecatedPlugin\("(.+?)".*" replace="\1|" flags="gi"/> |
---|
| 616 | </tokenfilter> |
---|
| 617 | <striplinebreaks/> |
---|
| 618 | <tokenfilter> |
---|
| 619 | <replaceregex pattern="\|$" replace="" flags="gi"/> |
---|
| 620 | </tokenfilter> |
---|
| 621 | </filterchain> |
---|
| 622 | </loadfile> |
---|
[5498] | 623 | <!-- Download list of plugins --> |
---|
[4166] | 624 | <loadresource property="plugins"> |
---|
[6955] | 625 | <url url="https://josm.openstreetmap.de/plugin"/> |
---|
[4166] | 626 | <filterchain> |
---|
| 627 | <linecontainsregexp negate="true"> |
---|
| 628 | <regexp pattern="^\t.*"/> |
---|
| 629 | </linecontainsregexp> |
---|
| 630 | <linecontainsregexp negate="true"> |
---|
| 631 | <regexp pattern="${deprecated-plugins}"/> |
---|
| 632 | </linecontainsregexp> |
---|
| 633 | <tokenfilter> |
---|
| 634 | <replaceregex pattern="^.*;" replace="" flags="gi"/> |
---|
| 635 | </tokenfilter> |
---|
| 636 | </filterchain> |
---|
[6133] | 637 | </loadresource> |
---|
| 638 | <!-- Delete files that are not in plugin list (like old plugins) --> |
---|
| 639 | <loadresource property="file-list"> |
---|
| 640 | <propertyresource name="plugins"/> |
---|
| 641 | <filterchain> |
---|
| 642 | <tokenfilter> |
---|
| 643 | <replaceregex pattern="^.*/(.*)$" replace="\1\|" flags=""/> |
---|
| 644 | </tokenfilter> |
---|
| 645 | <striplinebreaks/> |
---|
| 646 | <tokenfilter> |
---|
| 647 | <replaceregex pattern="\|$" replace="" flags="gi"/> |
---|
[9765] | 648 | </tokenfilter> |
---|
[6133] | 649 | </filterchain> |
---|
| 650 | </loadresource> |
---|
| 651 | <delete> |
---|
| 652 | <restrict> |
---|
| 653 | <fileset dir="${dir}"/> |
---|
| 654 | <not> |
---|
| 655 | <name regex="${file-list}"/> |
---|
| 656 | </not> |
---|
| 657 | </restrict> |
---|
| 658 | </delete> |
---|
| 659 | <!-- Download plugins --> |
---|
[4166] | 660 | <copy todir="${dir}" flatten="true"> |
---|
| 661 | <resourcelist> |
---|
| 662 | <string value="${plugins}"/> |
---|
| 663 | </resourcelist> |
---|
| 664 | </copy> |
---|
| 665 | <!-- Check plugins --> |
---|
[5498] | 666 | <as:build-signatures destfile="${dir}/api.sig"> |
---|
| 667 | <path> |
---|
[12628] | 668 | <fileset file="${dist-optimized.jar}"/> |
---|
[5498] | 669 | <fileset file="${java.home}/lib/rt.jar"/> |
---|
| 670 | <fileset file="${java.home}/lib/jce.jar"/> |
---|
| 671 | </path> |
---|
[6133] | 672 | </as:build-signatures> |
---|
[4166] | 673 | <as:check-signature signature="${dir}/api.sig"> |
---|
[7367] | 674 | <ignore classname="au.edu.*"/> |
---|
| 675 | <ignore classname="au.com.*"/> |
---|
| 676 | <ignore classname="com.*"/> |
---|
[7934] | 677 | <ignore classname="de.miethxml.*"/> |
---|
[8090] | 678 | <ignore classname="javafx.*"/> |
---|
[7367] | 679 | <ignore classname="javax.*"/> |
---|
| 680 | <ignore classname="jogamp.*"/> |
---|
| 681 | <ignore classname="junit.*"/> |
---|
| 682 | <ignore classname="net.sf.*"/> |
---|
| 683 | <ignore classname="nu.xom.*"/> |
---|
| 684 | <ignore classname="org.apache.*"/> |
---|
| 685 | <ignore classname="org.codehaus.*"/> |
---|
| 686 | <ignore classname="org.dom4j.*"/> |
---|
| 687 | <ignore classname="org.hsqldb.*"/> |
---|
| 688 | <ignore classname="org.ibex.*"/> |
---|
[7934] | 689 | <ignore classname="org.iso_relax.*"/> |
---|
[7367] | 690 | <ignore classname="org.jaitools.*"/> |
---|
| 691 | <ignore classname="org.jaxen.*"/> |
---|
| 692 | <ignore classname="org.jdom2.*"/> |
---|
[4166] | 693 | <ignore classname="org.jgraph.*"/> |
---|
[7367] | 694 | <ignore classname="org.joda.time.*"/> |
---|
[4166] | 695 | <ignore classname="org.jvnet.staxex.*"/> |
---|
[7367] | 696 | <ignore classname="org.kxml2.*"/> |
---|
[8090] | 697 | <ignore classname="org.objectweb.*"/> |
---|
[7367] | 698 | <ignore classname="org.python.*"/> |
---|
| 699 | <ignore classname="org.slf4j.*"/> |
---|
[8173] | 700 | <!-- plugins used by another ones --> |
---|
[7494] | 701 | <ignore classname="org.openstreetmap.josm.plugins.geotools.*"/> |
---|
[7934] | 702 | <ignore classname="org.openstreetmap.josm.plugins.jna.*"/> |
---|
[7494] | 703 | <ignore classname="org.openstreetmap.josm.plugins.jts.*"/> |
---|
| 704 | <ignore classname="org.openstreetmap.josm.plugins.log4j.*"/> |
---|
| 705 | <ignore classname="org.openstreetmap.josm.plugins.utilsplugin2.*"/> |
---|
[4166] | 706 | <path path="${dir}"/> |
---|
| 707 | </as:check-signature> |
---|
| 708 | </target> |
---|
[4838] | 709 | |
---|
[8687] | 710 | <macrodef name="_taginfo"> |
---|
| 711 | <attribute name="type"/> |
---|
| 712 | <attribute name="output"/> |
---|
| 713 | <sequential> |
---|
| 714 | <echo message="Generating Taginfo for type @{type} to @{output}"/> |
---|
[12628] | 715 | <groovy src="${taginfoextract}" classpath="${dist.jar}:tools/findbugs/annotations.jar"> |
---|
[8687] | 716 | <arg value="-t"/> |
---|
| 717 | <arg value="@{type}"/> |
---|
| 718 | <arg value="--noexit"/> |
---|
| 719 | <arg value="--svnweb"/> |
---|
| 720 | <arg value="--imgurlprefix"/> |
---|
| 721 | <arg value="${imgurlprefix}"/> |
---|
| 722 | <arg value="-o"/> |
---|
| 723 | <arg value="@{output}"/> |
---|
| 724 | </groovy> |
---|
| 725 | </sequential> |
---|
| 726 | </macrodef> |
---|
| 727 | |
---|
| 728 | <target name="taginfo" depends="dist"> |
---|
| 729 | <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${groovy.jar};tools/commons-cli-1.3.1.jar"/> |
---|
[9880] | 730 | <property name="taginfoextract" value="scripts/TagInfoExtract.groovy"/> |
---|
[8687] | 731 | <property name="imgurlprefix" value="http://josm.openstreetmap.de/download/taginfo/taginfo-img"/> |
---|
[9250] | 732 | <_taginfo type="mappaint" output="taginfo_style.json"/> |
---|
| 733 | <_taginfo type="presets" output="taginfo_presets.json"/> |
---|
| 734 | <_taginfo type="external_presets" output="taginfo_external_presets.json"/> |
---|
[8687] | 735 | </target> |
---|
| 736 | |
---|
[9765] | 737 | <target name="imageryindex" depends="init-properties"> |
---|
[9505] | 738 | <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${groovy.jar};tools/commons-cli-1.3.1.jar"/> |
---|
| 739 | <echo message="Checking editor imagery difference"/> |
---|
[12628] | 740 | <groovy src="scripts/SyncEditorLayerIndex.groovy" classpath="${dist.jar}"> |
---|
[11965] | 741 | <arg value="-noeli"/> |
---|
[11964] | 742 | <arg value="-p"/> |
---|
[11965] | 743 | <arg value="imagery_eliout.imagery.xml"/> |
---|
[11964] | 744 | <arg value="-q"/> |
---|
[11965] | 745 | <arg value="imagery_josmout.imagery.xml"/> |
---|
[9505] | 746 | </groovy> |
---|
| 747 | </target> |
---|
| 748 | |
---|
| 749 | <target name="imageryindexdownload"> |
---|
| 750 | <exec append="false" executable="wget" failifexecutionfails="true"> |
---|
| 751 | <arg value="https://josm.openstreetmap.de/maps"/> |
---|
| 752 | <arg value="-O"/> |
---|
[11965] | 753 | <arg value="imagery_josm.imagery.xml"/> |
---|
[9505] | 754 | <arg value="--unlink"/> |
---|
| 755 | </exec> |
---|
| 756 | <exec append="false" executable="wget" failifexecutionfails="true"> |
---|
[11238] | 757 | <arg value="https://josm.openstreetmap.de/wiki/ImageryCompareIgnores?format=txt"/> |
---|
| 758 | <arg value="-O"/> |
---|
[11965] | 759 | <arg value="imagery_josm.ignores.txt"/> |
---|
[11238] | 760 | <arg value="--unlink"/> |
---|
| 761 | </exec> |
---|
| 762 | <exec append="false" executable="wget" failifexecutionfails="true"> |
---|
[11857] | 763 | <arg value="https://raw.githubusercontent.com/osmlab/editor-layer-index/gh-pages/imagery.geojson"/> |
---|
[9505] | 764 | <arg value="-O"/> |
---|
[11965] | 765 | <arg value="imagery_eli.geojson"/> |
---|
[9505] | 766 | <arg value="--unlink"/> |
---|
| 767 | </exec> |
---|
| 768 | <antcall target="imageryindex"/> |
---|
| 769 | </target> |
---|
| 770 | |
---|
[12582] | 771 | <target name="checkstyle-compile" depends="init-properties"> |
---|
| 772 | <mkdir dir="${checkstyle-build.dir}"/> |
---|
[12586] | 773 | <javac sourcepath="" srcdir="${base.dir}/tools/checkstyle/src" failonerror="true" |
---|
[12628] | 774 | destdir="${checkstyle-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" |
---|
[12582] | 775 | includeantruntime="false" createMissingPackageInfoClass="false" |
---|
| 776 | encoding="UTF-8" classpath="tools/checkstyle/checkstyle-all.jar"> |
---|
| 777 | </javac> |
---|
| 778 | </target> |
---|
| 779 | <target name="checkstyle" depends="checkstyle-compile"> |
---|
[9765] | 780 | <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties" |
---|
[12583] | 781 | classpath="tools/checkstyle/checkstyle-all.jar:${checkstyle-build.dir}"/> |
---|
[8508] | 782 | <checkstyle config="tools/checkstyle/josm_checks.xml"> |
---|
[9765] | 783 | <fileset dir="${base.dir}/src/org/openstreetmap/josm" includes="**/*.java" |
---|
[9250] | 784 | excludes="gui/mappaint/mapcss/parsergen/*.java"/> |
---|
[9765] | 785 | <fileset dir="${base.dir}/test" includes="**/*.java"/> |
---|
[11681] | 786 | <formatter type="plain"/> |
---|
[8508] | 787 | <formatter type="xml" toFile="checkstyle-josm.xml"/> |
---|
| 788 | </checkstyle> |
---|
| 789 | </target> |
---|
| 790 | |
---|
[4838] | 791 | <target name="findbugs" depends="dist"> |
---|
[6133] | 792 | <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="tools/findbugs/findbugs-ant.jar"/> |
---|
[4838] | 793 | <path id="findbugs-classpath"> |
---|
[9765] | 794 | <fileset dir="${base.dir}/tools/findbugs/"> |
---|
[4838] | 795 | <include name="*.jar"/> |
---|
| 796 | </fileset> |
---|
| 797 | </path> |
---|
[6133] | 798 | <property name="findbugs-classpath" refid="findbugs-classpath"/> |
---|
| 799 | <findbugs output="xml" |
---|
[4838] | 800 | outputFile="findbugs-josm.xml" |
---|
[6133] | 801 | classpath="${findbugs-classpath}" |
---|
| 802 | pluginList="" |
---|
| 803 | excludeFilter="tools/findbugs/josm-filter.xml" |
---|
| 804 | effort="max" |
---|
[10223] | 805 | reportLevel="low" |
---|
[6133] | 806 | > |
---|
[9765] | 807 | <sourcePath path="${base.dir}/src" /> |
---|
[12628] | 808 | <class location="${dist.jar}" /> |
---|
[6133] | 809 | </findbugs> |
---|
[4838] | 810 | </target> |
---|
[11713] | 811 | |
---|
| 812 | <target name="pmd" depends="init-properties"> |
---|
| 813 | <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpath="${toString:pmd.classpath}"/> |
---|
| 814 | <pmd shortFilenames="true" encoding="UTF-8"> |
---|
[12628] | 815 | <sourceLanguage name="java" version="${java.lang.version}" /> |
---|
[11713] | 816 | <ruleset>${base.dir}/tools/pmd/josm-ruleset.xml</ruleset> |
---|
| 817 | <formatter type="text" toConsole="true" /> |
---|
| 818 | <formatter type="xml" toFile="pmd-josm.xml"> |
---|
| 819 | <param name="encoding" value="UTF-8" /> |
---|
| 820 | </formatter> |
---|
| 821 | <fileset dir="${src.dir}"> |
---|
| 822 | <include name="org/openstreetmap/josm/**/*.java"/> |
---|
| 823 | <exclude name="org/openstreetmap/josm/gui/mappaint/mapcss/parsergen/*.java" /> |
---|
| 824 | </fileset> |
---|
| 825 | </pmd> |
---|
| 826 | </target> |
---|
| 827 | |
---|
[5323] | 828 | <target name="run" depends="dist"> |
---|
[12628] | 829 | <java jar="${dist.jar}" fork="true"> |
---|
[5323] | 830 | <arg value="--set=expert=true"/> |
---|
| 831 | <arg value="--set=remotecontrol.enabled=true"/> |
---|
| 832 | <arg value="--set=debug.edt-checker.enable=false"/> |
---|
| 833 | <jvmarg value="-Djosm.home=/tmp/.josm/"/> |
---|
| 834 | </java> |
---|
| 835 | </target> |
---|
[9765] | 836 | <!-- |
---|
| 837 | ** Compile build script for generating projection list. |
---|
| 838 | --> |
---|
[10850] | 839 | <target name="epsg-compile" depends="init-properties"> |
---|
[9765] | 840 | <property name="proj-classpath" location="${build.dir}"/> |
---|
| 841 | <mkdir dir="${proj-build.dir}"/> |
---|
| 842 | <javac sourcepath="" srcdir="${base.dir}/scripts" failonerror="true" |
---|
[12628] | 843 | destdir="${proj-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" |
---|
[9765] | 844 | includeantruntime="false" createMissingPackageInfoClass="false" |
---|
| 845 | encoding="UTF-8" classpath="${proj-classpath}"> |
---|
[9133] | 846 | </javac> |
---|
| 847 | </target> |
---|
[9765] | 848 | <!-- |
---|
| 849 | ** generate projection list. |
---|
| 850 | --> |
---|
[9133] | 851 | <target name="epsg" depends="epsg-compile"> |
---|
| 852 | <touch file="${epsg.output}"/> |
---|
[10259] | 853 | <java classname="BuildProjectionDefinitions" failonerror="true" fork="true"> |
---|
[9735] | 854 | <sysproperty key="java.awt.headless" value="true"/> |
---|
[9133] | 855 | <classpath> |
---|
[9765] | 856 | <pathelement path="${base.dir}"/> |
---|
| 857 | <pathelement path="${proj-classpath}"/> |
---|
| 858 | <pathelement path="${proj-build.dir}"/> |
---|
[9133] | 859 | </classpath> |
---|
[9765] | 860 | <arg value="${base.dir}"/> |
---|
[9133] | 861 | </java> |
---|
| 862 | </target> |
---|
[4166] | 863 | </project> |
---|