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