[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
|
---|
| 7 | ** This will create 'josm-custom.jar' in directory 'dist'. See also
|
---|
| 8 | ** https://josm.openstreetmap.de/wiki/CreateBuild
|
---|
| 9 | **
|
---|
| 10 | -->
|
---|
[6133] | 11 | <project xmlns:as="antlib:org.codehaus.mojo.animal_sniffer" name="josm" default="dist" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
|
---|
[4252] | 12 | <property name="test.dir" location="test"/>
|
---|
| 13 | <property name="src.dir" location="src"/>
|
---|
| 14 | <property name="build.dir" location="build"/>
|
---|
| 15 | <property name="javacc.home" location="tools"/>
|
---|
| 16 | <property name="mapcss.dir" location="${src.dir}/org/openstreetmap/josm/gui/mappaint/mapcss"/>
|
---|
[4166] | 17 | <!-- build parameter: compression level (ant -Dclevel=N)
|
---|
| 18 | N ranges from 0 (no compression) to 9 (maximum compression)
|
---|
| 19 | default: 9 -->
|
---|
| 20 | <condition property="clevel" value="${clevel}" else="9">
|
---|
| 21 | <isset property="clevel"/>
|
---|
| 22 | </condition>
|
---|
| 23 | <!-- Java classpath addition (all jar files to compile tests with this) -->
|
---|
[4252] | 24 | <path id="classpath">
|
---|
[4166] | 25 | <fileset dir="lib">
|
---|
| 26 | <include name="**/*.jar"/>
|
---|
| 27 | </fileset>
|
---|
[4252] | 28 | </path>
|
---|
| 29 |
|
---|
[4166] | 30 | <!--
|
---|
[6133] | 31 | ** Used by Eclipse ant builder for updating
|
---|
| 32 | ** the REVISION file used by JOSM
|
---|
| 33 | -->
|
---|
[4166] | 34 | <target name="create-revision-eclipse">
|
---|
| 35 | <property name="revision.dir" value="bin"/>
|
---|
| 36 | <antcall target="create-revision"/>
|
---|
| 37 | </target>
|
---|
| 38 | <!--
|
---|
[6133] | 39 | ** Creates the REVISION file to be included in the distribution
|
---|
| 40 | -->
|
---|
[4166] | 41 | <target name="create-revision">
|
---|
| 42 | <property name="revision.dir" value="${build.dir}"/>
|
---|
| 43 | <exec append="false" output="REVISION.XML" executable="svn" failifexecutionfails="false">
|
---|
| 44 | <env key="LANG" value="C"/>
|
---|
| 45 | <arg value="info"/>
|
---|
| 46 | <arg value="--xml"/>
|
---|
| 47 | <arg value="."/>
|
---|
| 48 | </exec>
|
---|
| 49 | <xmlproperty file="REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
| 50 | <delete file="REVISION.XML"/>
|
---|
| 51 | <tstamp>
|
---|
| 52 | <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss"/>
|
---|
| 53 | </tstamp>
|
---|
| 54 | <property name="version.entry.commit.revision" value="UNKNOWN"/>
|
---|
| 55 | <mkdir dir="${revision.dir}"/>
|
---|
[5362] | 56 | <!-- add Build-Name: ... when making special builds, e.g. DEBIAN -->
|
---|
[4166] | 57 | <echo file="${revision.dir}/REVISION">
|
---|
| 58 | # automatically generated by JOSM build.xml - do not edit
|
---|
| 59 | Revision: ${version.entry.commit.revision}
|
---|
| 60 | Is-Local-Build: true
|
---|
| 61 | Build-Date: ${build.tstamp}
|
---|
| 62 | </echo>
|
---|
| 63 | </target>
|
---|
[6208] | 64 | <target name="check-schemas">
|
---|
| 65 | <schemavalidate file="data/defaultpresets.xml" >
|
---|
| 66 | <schema namespace="http://josm.openstreetmap.de/tagging-preset-1.0" file="data/tagging-preset.xsd" />
|
---|
| 67 | </schemavalidate>
|
---|
| 68 | <schemavalidate file="styles/standard/elemstyles.xml" >
|
---|
| 69 | <schema namespace="http://josm.openstreetmap.de/mappaint-style-1.0" file="data/mappaint-style.xsd" />
|
---|
| 70 | </schemavalidate>
|
---|
| 71 | </target>
|
---|
| 72 | <target name="dist" depends="compile,create-revision,check-schemas">
|
---|
[4166] | 73 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
---|
| 74 | <env key="LANG" value="C"/>
|
---|
| 75 | <arg value="info"/>
|
---|
| 76 | <arg value="--xml"/>
|
---|
| 77 | <arg value="."/>
|
---|
| 78 | </exec>
|
---|
| 79 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
| 80 | <delete file="REVISION"/>
|
---|
| 81 | <property name="version.entry.commit.revision" value="UNKNOWN"/>
|
---|
| 82 | <property name="version.entry.commit.date" value="UNKNOWN"/>
|
---|
| 83 | <echo>Revision ${version.entry.commit.revision}</echo>
|
---|
| 84 | <copy file="CONTRIBUTION" todir="build"/>
|
---|
| 85 | <copy file="README" todir="build"/>
|
---|
| 86 | <copy file="LICENSE" todir="build"/>
|
---|
| 87 | <!-- create josm-custom.jar -->
|
---|
| 88 | <delete file="dist/josm-custom.jar"/>
|
---|
| 89 | <jar destfile="dist/josm-custom.jar" basedir="build" level="${clevel}">
|
---|
| 90 | <!-- add attribute excludes="**/*BZip2*,**/*Bzip2*" to create a non-bzip2 supporting jar -->
|
---|
| 91 | <manifest>
|
---|
| 92 | <attribute name="Main-class" value="JOSM"/>
|
---|
| 93 | <attribute name="Main-Version" value="${version.entry.commit.revision} SVN"/>
|
---|
| 94 | <attribute name="Main-Date" value="${version.entry.commit.date}"/>
|
---|
[6341] | 95 | <attribute name="Permissions" value="all-permissions"/>
|
---|
| 96 | <attribute name="Codebase" value="josm.openstreetmap.de"/>
|
---|
| 97 | <attribute name="Application-Name" value="JOSM - Java OpenStreetMap Editor"/>
|
---|
[4166] | 98 | </manifest>
|
---|
| 99 | <zipfileset dir="images" prefix="images"/>
|
---|
| 100 | <zipfileset dir="data" prefix="data"/>
|
---|
| 101 | <zipfileset dir="styles" prefix="styles"/>
|
---|
| 102 | <zipfileset dir="src/org/openstreetmap/gui/jmapviewer/images" prefix="org/openstreetmap/gui/jmapviewer/images"/>
|
---|
| 103 | <!-- All jar files necessary to run only JOSM (no tests) -->
|
---|
[4231] | 104 | <!-- <zipfileset src="lib/metadata-extractor-2.3.1-nosun.jar"/> -->
|
---|
| 105 | <!-- <zipfileset src="lib/signpost-core-1.2.1.1.jar"/> -->
|
---|
[4166] | 106 | </jar>
|
---|
| 107 | </target>
|
---|
[6217] | 108 | <!-- Compatibility Mac OS X target for Java 6 (incompatible with new on for Java 7, see #8654, #9035) -->
|
---|
[4166] | 109 | <target name="distmac" depends="dist">
|
---|
| 110 | <!-- modify MacOS X Info.plist file to hold the SVN version number -->
|
---|
| 111 | <copy file="macosx/JOSM.app/Contents/Info.plist" todir="build"/>
|
---|
| 112 | <replace file="build/Info.plist" token="@SVNVersion@" value="${version.entry.commit.revision}"/>
|
---|
| 113 | <!-- create ZIP file with MacOS X application bundle -->
|
---|
| 114 | <zip destfile="dist/josm-custom-macosx.zip" update="true">
|
---|
| 115 | <zipfileset dir="build" includes="CONTRIBUTION README LICENSE"/>
|
---|
| 116 | <zipfileset dir="macosx" includes="JOSM.app/Contents JOSM.app/Contents/MacOS JOSM.app/Contents/Resources JOSM.app/Contents/Resources/Java JOSM.app/Contents/PkgInfo JOSM.app/Contents/Resources/JOSM.icns"/>
|
---|
| 117 | <zipfileset dir="build" includes="Info.plist" prefix="JOSM.app/Contents"/>
|
---|
| 118 | <zipfileset dir="dist" includes="josm-custom.jar" prefix="JOSM.app/Contents/Resources/Java"/>
|
---|
| 119 | <zipfileset dir="macosx" includes="JOSM.app/Contents/MacOS/JOSM" filemode="755"/>
|
---|
| 120 | </zip>
|
---|
| 121 | </target>
|
---|
[6217] | 122 | <!-- New Mac OS X target for Java 7 -->
|
---|
[6216] | 123 | <target name="distmac7" depends="dist">
|
---|
[6217] | 124 | <!-- Using https://bitbucket.org/infinitekind/appbundler to create mac application bundle -->
|
---|
| 125 | <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="tools/appbundler-1.0ea.jar"/>
|
---|
| 126 | <!-- create MacOS X application bundle -->
|
---|
[6216] | 127 | <bundleapp outputdirectory="dist" name="JOSM" displayname="JOSM" executablename="JOSM" identifier="org.openstreetmap.josm"
|
---|
| 128 | mainclassname="org.openstreetmap.josm.gui.MainApplication"
|
---|
[6217] | 129 | copyright="JOSM, and all its integral parts, are released under the GNU General Public License v2 or later"
|
---|
[6216] | 130 | applicationCategory="public.app-category.utilities"
|
---|
| 131 | shortversion="${version.entry.commit.revision} SVN"
|
---|
| 132 | version="${version.entry.commit.revision} SVN"
|
---|
| 133 | icon="macosx/JOSM.app/Contents/Resources/JOSM.icns"
|
---|
[6217] | 134 | highResolutionCapable="true">
|
---|
[6216] | 135 |
|
---|
| 136 | <arch name="x86_64"/>
|
---|
| 137 | <arch name="i386"/>
|
---|
| 138 |
|
---|
| 139 | <classpath file="dist/josm-custom.jar"/>
|
---|
| 140 |
|
---|
| 141 | <option value="-Xmx512m"/>
|
---|
| 142 |
|
---|
| 143 | <option value="-Xdock:icon=Contents/Resources/JOSM.icns"/>
|
---|
| 144 | <option value="-Xdock:name=JOSM"/>
|
---|
| 145 |
|
---|
| 146 | <!-- OSX specific options, optional -->
|
---|
| 147 | <option value="-Dapple.laf.useScreenMenuBar=true"/>
|
---|
| 148 | <option value="-Dcom.apple.macos.use-file-dialog-packages=true"/>
|
---|
| 149 | <option value="-Dcom.apple.macos.useScreenMenuBar=true"/>
|
---|
| 150 | <option value="-Dcom.apple.mrj.application.apple.menu.about.name=JOSM"/>
|
---|
| 151 | <option value="-Dcom.apple.smallTabs=true"/>
|
---|
| 152 | </bundleapp>
|
---|
[6217] | 153 |
|
---|
| 154 | <!-- appbundler lacks the possibility of defining our own keys or using a template, so update the .plist manually -->
|
---|
| 155 | <taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" classpath="tools/xmltask.jar"/>
|
---|
| 156 |
|
---|
| 157 | <xmltask source="dist/JOSM.app/Contents/Info.plist" dest="dist/JOSM.app/Contents/Info.plist" indent="false">
|
---|
| 158 | <insert position="before" path="/plist/dict/key[1]"><![CDATA[<key>CFBundleAllowMixedLocalizations</key>
|
---|
| 159 | <string>true</string>
|
---|
| 160 | ]]></insert>
|
---|
| 161 | </xmltask>
|
---|
| 162 |
|
---|
[6216] | 163 | <!-- create ZIP file with MacOS X application bundle -->
|
---|
| 164 | <zip destfile="dist/josm-custom-macosx-java7.zip" update="true">
|
---|
| 165 | <zipfileset dir="build" includes="CONTRIBUTION README LICENSE"/>
|
---|
| 166 | <zipfileset dir="dist" includes="JOSM.app/**/*" filemode="755" />
|
---|
| 167 | </zip>
|
---|
[6217] | 168 | </target>
|
---|
[5392] | 169 | <target name="javacc" depends="init" unless="javacc.notRequired">
|
---|
[4252] | 170 | <mkdir dir="${mapcss.dir}/parsergen"/>
|
---|
[4257] | 171 | <exec append="false" executable="java" failifexecutionfails="true">
|
---|
| 172 | <arg value="-cp"/>
|
---|
| 173 | <arg value="${javacc.home}/javacc.jar"/>
|
---|
| 174 | <arg value="javacc"/>
|
---|
[6446] | 175 | <arg value="-JDK_VERSION=1.6"/>
|
---|
| 176 | <arg value="-GRAMMAR_ENCODING=UTF-8"/>
|
---|
| 177 | <arg value="-UNICODE_INPUT"/>
|
---|
[4257] | 178 | <arg value="-OUTPUT_DIRECTORY=${mapcss.dir}/parsergen"/>
|
---|
| 179 | <arg value="${mapcss.dir}/MapCSSParser.jj"/>
|
---|
| 180 | </exec>
|
---|
[4252] | 181 | </target>
|
---|
[5392] | 182 | <target name="compile" depends="init,javacc">
|
---|
[5502] | 183 | <javac srcdir="src" includes="com/**,oauth/**,org/apache/commons/codec/**" destdir="build" target="1.6" source="1.6" debug="on" includeantruntime="false" encoding="iso-8859-1"/>
|
---|
| 184 | <javac srcdir="src" excludes="com/**,oauth/**,org/apache/commons/codec/**" destdir="build" target="1.6" source="1.6" debug="on" includeantruntime="false" encoding="UTF-8">
|
---|
[4166] | 185 | <compilerarg value="-Xlint:deprecation"/>
|
---|
| 186 | <compilerarg value="-Xlint:unchecked"/>
|
---|
| 187 | </javac>
|
---|
| 188 | </target>
|
---|
| 189 | <target name="init">
|
---|
[5392] | 190 | <uptodate property="javacc.notRequired" targetfile="${mapcss.dir}/parsergen/MapCSSParser.java" >
|
---|
| 191 | <srcfiles dir="${mapcss.dir}" includes="MapCSSParser.jj"/>
|
---|
| 192 | </uptodate>
|
---|
[4166] | 193 | <mkdir dir="build"/>
|
---|
| 194 | <mkdir dir="dist"/>
|
---|
| 195 | </target>
|
---|
[5263] | 196 | <target name="javadoc">
|
---|
| 197 | <javadoc destdir="javadoc"
|
---|
| 198 | sourcepath="src"
|
---|
| 199 | packagenames="org.openstreetmap.josm.*,org.openstreetmap.gui.jmapviewer.*"
|
---|
| 200 | windowtitle="JOSM"
|
---|
| 201 | use="true"
|
---|
[5481] | 202 | private="true"
|
---|
[5263] | 203 | linksource="true"
|
---|
| 204 | author="false">
|
---|
| 205 | <link href="http://docs.oracle.com/javase/6/docs/api"/>
|
---|
| 206 | <doctitle><![CDATA[<h2>JOSM - Javadoc</h2>]]></doctitle>
|
---|
| 207 | <bottom><![CDATA[<a href="http://josm.openstreetmap.de/">JOSM</a>]]></bottom>
|
---|
| 208 | </javadoc>
|
---|
| 209 | </target>
|
---|
[4166] | 210 | <target name="clean">
|
---|
| 211 | <delete dir="build"/>
|
---|
| 212 | <delete dir="dist"/>
|
---|
[4252] | 213 | <delete dir="${mapcss.dir}/parsergen"/>
|
---|
[4166] | 214 | </target>
|
---|
| 215 | <path id="test.classpath">
|
---|
| 216 | <fileset dir="${test.dir}/lib">
|
---|
| 217 | <include name="**/*.jar"/>
|
---|
| 218 | </fileset>
|
---|
| 219 | <fileset dir="lib">
|
---|
| 220 | <include name="**/*.jar"/>
|
---|
| 221 | </fileset>
|
---|
| 222 | <pathelement path="dist/josm-custom.jar"/>
|
---|
| 223 | </path>
|
---|
| 224 | <target name="test-init">
|
---|
[6121] | 225 | <mkdir dir="${test.dir}/build"/>
|
---|
[4166] | 226 | <mkdir dir="${test.dir}/report"/>
|
---|
| 227 | </target>
|
---|
| 228 | <target name="test-clean">
|
---|
[6121] | 229 | <delete dir="${test.dir}/build"/>
|
---|
[4166] | 230 | <delete dir="${test.dir}/report"/>
|
---|
[6133] | 231 | <delete file="${test.dir}/jacoco.exec" />
|
---|
[4166] | 232 | </target>
|
---|
| 233 | <target name="test-compile" depends="test-init,dist">
|
---|
[6121] | 234 | <javac srcdir="${test.dir}/unit" classpathref="test.classpath" destdir="${test.dir}/build" target="1.6" source="1.6" debug="on" includeantruntime="false" encoding="UTF-8">
|
---|
[4166] | 235 | <compilerarg value="-Xlint:deprecation"/>
|
---|
| 236 | <compilerarg value="-Xlint:unchecked"/>
|
---|
| 237 | </javac>
|
---|
[6121] | 238 | <javac srcdir="${test.dir}/functional" classpathref="test.classpath" destdir="${test.dir}/build" target="1.6" source="1.6" debug="on" includeantruntime="false" encoding="UTF-8">
|
---|
[4166] | 239 | <compilerarg value="-Xlint:deprecation"/>
|
---|
| 240 | <compilerarg value="-Xlint:unchecked"/>
|
---|
| 241 | </javac>
|
---|
| 242 | </target>
|
---|
| 243 | <target name="test" depends="test-compile">
|
---|
[6133] | 244 | <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="tools/jacocoant.jar" />
|
---|
| 245 | <jacoco:coverage destfile="${test.dir}/jacoco.exec">
|
---|
| 246 | <junit printsummary="yes" fork="true" forkmode="once">
|
---|
| 247 | <sysproperty key="josm.home" value="${test.dir}/config/unit-josm.home"/>
|
---|
[6144] | 248 | <sysproperty key="josm.test.data" value="${test.dir}/data"/>
|
---|
[6133] | 249 | <sysproperty key="java.awt.headless" value="true"/>
|
---|
[6144] | 250 | <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
|
---|
[6133] | 251 | <classpath>
|
---|
| 252 | <path refid="test.classpath"/>
|
---|
| 253 | <pathelement path="${test.dir}/build"/>
|
---|
| 254 | <pathelement path="${test.dir}/config"/>
|
---|
| 255 | </classpath>
|
---|
| 256 | <formatter type="plain"/>
|
---|
| 257 | <formatter type="xml"/>
|
---|
| 258 | <batchtest fork="yes" todir="${test.dir}/report">
|
---|
| 259 | <fileset dir="${test.dir}/unit" includes="**/*.java"/>
|
---|
| 260 | </batchtest>
|
---|
| 261 | </junit>
|
---|
| 262 | </jacoco:coverage>
|
---|
[4166] | 263 | </target>
|
---|
| 264 | <target name="test-html" depends="test" description="Generate HTML test reports">
|
---|
| 265 | <!-- May require additional ant dependencies like ant-trax package -->
|
---|
| 266 | <junitreport todir="${test.dir}/report">
|
---|
| 267 | <fileset dir="${test.dir}/report">
|
---|
| 268 | <include name="TEST-*.xml"/>
|
---|
| 269 | </fileset>
|
---|
| 270 | <report todir="${test.dir}/report/html"/>
|
---|
| 271 | </junitreport>
|
---|
[6133] | 272 | <jacoco:report>
|
---|
| 273 | <executiondata>
|
---|
| 274 | <file file="${test.dir}/jacoco.exec"/>
|
---|
| 275 | </executiondata>
|
---|
| 276 | <structure name="JOSM Test Coverage">
|
---|
| 277 | <classfiles>
|
---|
| 278 | <fileset dir="${build.dir}" includes="org/openstreetmap/"/>
|
---|
| 279 | </classfiles>
|
---|
| 280 | <sourcefiles encoding="UTF-8">
|
---|
| 281 | <fileset dir="${src.dir}" includes="org/openstreetmap/"/>
|
---|
| 282 | </sourcefiles>
|
---|
| 283 | </structure>
|
---|
[6134] | 284 | <html destdir="${test.dir}/report/jacoco"/>
|
---|
[6133] | 285 | </jacoco:report>
|
---|
[4166] | 286 | </target>
|
---|
| 287 | <target name="dist-optimized" depends="dist">
|
---|
| 288 | <taskdef resource="proguard/ant/task.properties" classpath="tools/proguard.jar"/>
|
---|
| 289 | <proguard>
|
---|
| 290 | -injars dist/josm-custom.jar
|
---|
| 291 | -outjars dist/josm-custom-optimized.jar
|
---|
| 292 |
|
---|
| 293 | -libraryjars ${java.home}/lib/rt.jar
|
---|
| 294 | -libraryjars ${java.home}/lib/jce.jar
|
---|
| 295 |
|
---|
| 296 | -dontoptimize
|
---|
| 297 | -dontobfuscate
|
---|
| 298 |
|
---|
[4730] | 299 | # These options probably are not necessary (and make processing a bit slower)
|
---|
[4166] | 300 | -dontskipnonpubliclibraryclasses
|
---|
[4730] | 301 | -dontskipnonpubliclibraryclassmembers
|
---|
[4166] | 302 |
|
---|
| 303 | -keepclasseswithmembers public class org.openstreetmap.josm.gui.MainApplication {
|
---|
| 304 | public static void main(java.lang.String[]);
|
---|
| 305 | }
|
---|
[4730] | 306 | -keepclasseswithmembers public class org.openstreetmap.josm.gui.MainApplet
|
---|
[4166] | 307 |
|
---|
| 308 | -keep class JOSM
|
---|
| 309 | -keep class * extends org.openstreetmap.josm.io.FileImporter
|
---|
| 310 | -keep class * extends org.openstreetmap.josm.io.FileExporter
|
---|
[4730] | 311 | -keep class org.openstreetmap.josm.data.imagery.types.Adapter1
|
---|
| 312 | -keep class org.openstreetmap.josm.actions.search.SearchCompiler$Never
|
---|
[4166] | 313 |
|
---|
| 314 | -keepclassmembers enum * {
|
---|
| 315 | public static **[] values();
|
---|
| 316 | public static ** valueOf(java.lang.String);
|
---|
| 317 | }
|
---|
| 318 |
|
---|
[4730] | 319 | # Keep unused public methods (can be useful for plugins)
|
---|
[4166] | 320 | -keepclassmembers class * {
|
---|
| 321 | public protected *;
|
---|
| 322 | }
|
---|
[4838] | 323 |
|
---|
[4730] | 324 | # Disable annoying [proguard] Note: the configuration keeps the entry point '...', but not the descriptor class '...'. This notes should not be a problem as we don't use obfuscation
|
---|
| 325 | -dontnote
|
---|
[6133] | 326 | </proguard>
|
---|
[4166] | 327 | </target>
|
---|
| 328 | <target name="check-plugins" depends="dist-optimized">
|
---|
| 329 | <echo message="Check of plugins binary compatibility (needs ant 1.8)"/>
|
---|
| 330 | <local name="dir"/>
|
---|
| 331 | <local name="plugins"/>
|
---|
| 332 | <property name="dir" value="plugin-check"/>
|
---|
| 333 | <typedef uri="antlib:org.codehaus.mojo.animal_sniffer">
|
---|
[5498] | 334 | <classpath path="tools/animal-sniffer-ant-tasks-1.8.jar"/>
|
---|
[4166] | 335 | </typedef>
|
---|
| 336 | <mkdir dir="${dir}"/>
|
---|
| 337 | <!-- List of deprecated plugins -->
|
---|
| 338 | <loadfile property="deprecated-plugins" srcFile="src/org/openstreetmap/josm/plugins/PluginHandler.java">
|
---|
| 339 | <filterchain>
|
---|
| 340 | <linecontains>
|
---|
| 341 | <contains value="new DeprecatedPlugin("/>
|
---|
| 342 | </linecontains>
|
---|
| 343 | <tokenfilter>
|
---|
| 344 | <replaceregex pattern=".*new DeprecatedPlugin\("(.+?)".*" replace="\1|" flags="gi"/>
|
---|
| 345 | </tokenfilter>
|
---|
| 346 | <striplinebreaks/>
|
---|
| 347 | <tokenfilter>
|
---|
| 348 | <replaceregex pattern="\|$" replace="" flags="gi"/>
|
---|
| 349 | </tokenfilter>
|
---|
| 350 | </filterchain>
|
---|
| 351 | </loadfile>
|
---|
[5498] | 352 | <!-- Download list of plugins -->
|
---|
[4166] | 353 | <loadresource property="plugins">
|
---|
| 354 | <url url="http://josm.openstreetmap.de/plugin"/>
|
---|
| 355 | <filterchain>
|
---|
| 356 | <linecontainsregexp negate="true">
|
---|
| 357 | <regexp pattern="^\t.*"/>
|
---|
| 358 | </linecontainsregexp>
|
---|
| 359 | <linecontainsregexp negate="true">
|
---|
| 360 | <regexp pattern="${deprecated-plugins}"/>
|
---|
| 361 | </linecontainsregexp>
|
---|
| 362 | <tokenfilter>
|
---|
| 363 | <replaceregex pattern="^.*;" replace="" flags="gi"/>
|
---|
| 364 | </tokenfilter>
|
---|
| 365 | </filterchain>
|
---|
[6133] | 366 | </loadresource>
|
---|
| 367 | <!-- Delete files that are not in plugin list (like old plugins) -->
|
---|
| 368 | <loadresource property="file-list">
|
---|
| 369 | <propertyresource name="plugins"/>
|
---|
| 370 | <filterchain>
|
---|
| 371 | <tokenfilter>
|
---|
| 372 | <replaceregex pattern="^.*/(.*)$" replace="\1\|" flags=""/>
|
---|
| 373 | </tokenfilter>
|
---|
| 374 | <striplinebreaks/>
|
---|
| 375 | <tokenfilter>
|
---|
| 376 | <replaceregex pattern="\|$" replace="" flags="gi"/>
|
---|
| 377 | </tokenfilter>
|
---|
| 378 | </filterchain>
|
---|
| 379 | </loadresource>
|
---|
| 380 | <delete>
|
---|
| 381 | <restrict>
|
---|
| 382 | <fileset dir="${dir}"/>
|
---|
| 383 | <not>
|
---|
| 384 | <name regex="${file-list}"/>
|
---|
| 385 | </not>
|
---|
| 386 | </restrict>
|
---|
| 387 | </delete>
|
---|
| 388 | <!-- Download plugins -->
|
---|
[4166] | 389 | <copy todir="${dir}" flatten="true">
|
---|
| 390 | <resourcelist>
|
---|
| 391 | <string value="${plugins}"/>
|
---|
| 392 | </resourcelist>
|
---|
| 393 | </copy>
|
---|
| 394 | <!-- Check plugins -->
|
---|
[5498] | 395 | <as:build-signatures destfile="${dir}/api.sig">
|
---|
| 396 | <path>
|
---|
| 397 | <fileset file="dist/josm-custom-optimized.jar"/>
|
---|
| 398 | <fileset file="${java.home}/lib/rt.jar"/>
|
---|
| 399 | <fileset file="${java.home}/lib/jce.jar"/>
|
---|
| 400 | </path>
|
---|
[6133] | 401 | </as:build-signatures>
|
---|
[4166] | 402 | <as:check-signature signature="${dir}/api.sig">
|
---|
| 403 | <ignore classname="org.jgraph.*"/>
|
---|
| 404 | <ignore classname="com.touchgraph.*"/>
|
---|
| 405 | <ignore classname="com.sun.xml.fastinfoset.*"/>
|
---|
| 406 | <ignore classname="javax.jms.*"/>
|
---|
| 407 | <ignore classname="org.jvnet.staxex.*"/>
|
---|
| 408 | <ignore classname="javax.mail.*"/>
|
---|
| 409 | <ignore classname="com.sun.jdmk.*"/>
|
---|
| 410 | <ignore classname="org.apache.avalon.framework.logger.Logger"/>
|
---|
| 411 | <ignore classname="org.apache.log.*"/>
|
---|
| 412 | <ignore classname="junit.*"/>
|
---|
| 413 | <path path="${dir}"/>
|
---|
| 414 | </as:check-signature>
|
---|
| 415 | </target>
|
---|
[4838] | 416 |
|
---|
| 417 | <target name="findbugs" depends="dist">
|
---|
[6133] | 418 | <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="tools/findbugs/findbugs-ant.jar"/>
|
---|
[4838] | 419 | <path id="findbugs-classpath">
|
---|
| 420 | <fileset dir="tools/findbugs/">
|
---|
| 421 | <include name="*.jar"/>
|
---|
| 422 | </fileset>
|
---|
| 423 | </path>
|
---|
[6133] | 424 | <property name="findbugs-classpath" refid="findbugs-classpath"/>
|
---|
| 425 | <findbugs output="xml"
|
---|
[4838] | 426 | outputFile="findbugs-josm.xml"
|
---|
[6133] | 427 | classpath="${findbugs-classpath}"
|
---|
| 428 | pluginList=""
|
---|
| 429 | excludeFilter="tools/findbugs/josm-filter.xml"
|
---|
| 430 | effort="max"
|
---|
| 431 | >
|
---|
| 432 | <sourcePath path="${basedir}/src" />
|
---|
| 433 | <class location="${basedir}/dist/josm-custom.jar" />
|
---|
| 434 | </findbugs>
|
---|
[4838] | 435 | </target>
|
---|
[5323] | 436 | <target name="run" depends="dist">
|
---|
| 437 | <java jar="dist/josm-custom.jar" fork="true">
|
---|
| 438 | <arg value="--set=expert=true"/>
|
---|
| 439 | <arg value="--set=remotecontrol.enabled=true"/>
|
---|
| 440 | <arg value="--set=debug.edt-checker.enable=false"/>
|
---|
| 441 | <jvmarg value="-Djosm.home=/tmp/.josm/"/>
|
---|
| 442 | </java>
|
---|
| 443 | </target>
|
---|
[4838] | 444 |
|
---|
[4166] | 445 | </project>
|
---|