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