Changeset 19044 in josm for trunk/build.xml


Ignore:
Timestamp:
2024-04-19T11:43:25+02:00 (3 months ago)
Author:
stoecker
Message:

switch build-xml to java 11 and drop java 9 support, see #17858

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r19043 r19044  
    7979        <!-- When incrementing the minimum Java version, don't forget to update the Java versions users will update to
    8080             (PlatformHook#getJavaUrl, PlatformHook#startupSanityChecks and PlatformHook#warnSoonToBeUnsupportedJava) -->
    81         <property name="java.lang.version" value="8" />
     81        <property name="java.lang.version" value="11" />
    8282        <property name="test.headless" value="true" />
    8383        <property name="jacoco.includes" value="org.openstreetmap.josm.*" />
     
    9494        </condition>
    9595        <!-- For Java specific stuff by version -->
    96         <condition property="isJava9"><matches string="${ant.java.version}" pattern="(1.)?(9|[1-9][0-9])" /></condition>
    97         <condition property="isJava10"><matches string="${ant.java.version}" pattern="[1-9][0-9]" /></condition>
    98         <condition property="isJava11"><matches string="${ant.java.version}" pattern="1[1-9]|[2-9][0-9]" /></condition>
    99         <condition property="isJava12"><matches string="${ant.java.version}" pattern="1[2-9]|[2-9][0-9]" /></condition>
     96        <!-- <condition property="isJava12"><matches string="${ant.java.version}" pattern="1[2-9]|[2-9][0-9]" /></condition> -->
    10097        <condition property="isJava13"><matches string="${ant.java.version}" pattern="1[3-9]|[2-9][0-9]" /></condition>
    101         <condition property="isJava14"><matches string="${ant.java.version}" pattern="1[4-9]|[2-9][0-9]" /></condition>
     98        <!-- <condition property="isJava14"><matches string="${ant.java.version}" pattern="1[4-9]|[2-9][0-9]" /></condition> -->
     99        <!-- <condition property="isJava15"><matches string="${ant.java.version}" pattern="1[5-9]|[2-9][0-9]" /></condition> -->
    102100        <condition property="isJava16"><matches string="${ant.java.version}" pattern="1[6-9]|[2-9][0-9]" /></condition>
    103         <condition property="isJava18"><matches string="${ant.java.version}" pattern="1[8-9]|[2-9][0-9]" /></condition>
     101        <condition property="isJava17"><matches string="${ant.java.version}" pattern="1[7-9]|[2-9][0-9]" /></condition>
     102        <!-- <condition property="isJava18"><matches string="${ant.java.version}" pattern="1[8-9]|[2-9][0-9]" /></condition> -->
    104103        <condition property="isJava19"><matches string="${ant.java.version}" pattern="19|[2-9][0-9]" /></condition>
    105         <condition property="isJava20"><matches string="${ant.java.version}" pattern="[2-9][0-9]" /></condition>
     104        <!-- <condition property="isJava20"><matches string="${ant.java.version}" pattern="[2-9][0-9]" /></condition> -->
    106105        <condition property="isJava21"><matches string="${ant.java.version}" pattern="2[1-9]|[3-9][0-9]" /></condition>
    107106        <!-- Disable jacoco on Java 19+, see https://github.com/jacoco/jacoco/pull/1282 -->
     
    111110            </not>
    112111        </condition>
    113         <condition property="java.library.dir" value="jmods" else="lib">
    114             <isset property="isJava9"/>
    115         </condition>
     112        <property name="java.library.dir" value="jmods" />
    116113    </target>
    117114    <target name="init-svn-revision-xml" if="svn.present" depends="init-properties"
     
    224221        <element name="cp-elements" optional="true"/>
    225222        <sequential>
    226           <!-- RestrictedApiChecker was removed in error-prone 2.19 -->
    227           <local name="errorProne2.10"/>
    228           <property name="errorProne2.10" value="-Xep:RestrictedApiChecker:OFF" unless:set="isJava11"/>
    229           <local name="errorProne2.22+"/>
    230           <!-- LongDoubleConversion is disabled since SonarLint java:S1905 conflicts -->
    231           <property name="errorProne2.22+" value="-Xep:LongDoubleConversion:OFF" if:set="isJava11"/>
    232223          <javac sourcepath="@{sourcepath}" srcdir="@{srcdir}" fork="@{fork}"
    233224            includes="@{includes}" excludes="@{excludes}" destdir="@{destdir}" release="@{release}"
    234225            debug="@{debug}" includeantruntime="@{includeantruntime}" encoding="@{encoding}">
    235               <compilerarg value="-J-Xbootclasspath/p:${toString:errorprone_javac.classpath}" unless:set="isJava9"/>
    236226              <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
    237227              <compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
     
    259249              <!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
    260250              <compilerarg value="-XDignore.symbol.file"/>
    261               <compilerarg value="-Xplugin:ErrorProne -XepExcludedPaths:.*/parsergen/.* -Xep:ReferenceEquality:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:JdkObsolete:OFF -Xep:EqualsGetClass:OFF -Xep:UndefinedEquals:OFF -Xep:BadImport:OFF -Xep:AnnotateFormatMethod:OFF -Xep:JavaUtilDate:OFF -Xep:DoNotCallSuggester:OFF -Xep:BanSerializableRead:OFF ${errorProne2.10} -Xep:InlineMeSuggester:OFF ${errorProne2.22+}" unless:set="noErrorProne"/>
     251              <compilerarg value="-Xplugin:ErrorProne -XepExcludedPaths:.*/parsergen/.* -Xep:ReferenceEquality:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:JdkObsolete:OFF -Xep:EqualsGetClass:OFF -Xep:UndefinedEquals:OFF -Xep:BadImport:OFF -Xep:AnnotateFormatMethod:OFF -Xep:JavaUtilDate:OFF -Xep:DoNotCallSuggester:OFF -Xep:BanSerializableRead:OFF -Xep:InlineMeSuggester:OFF" unless:set="noErrorProne"/>
    262252              <compilerarg line="-Xmaxwarns 1000"/>
    263253              <compilerarg value="-Xplugin:semanticdb -sourceroot:@{srcdir} -targetroot:${build.dir}/semanticdb" if:set="lsif" />
     
    342332                linksource="true"
    343333                author="false">
    344             <link href="https://docs.oracle.com/javase/8/docs/api" unless:set="isJava11" />
    345             <link href="https://docs.oracle.com/en/java/javase/11/docs/api" if:set="isJava11" />
     334            <link href="https://docs.oracle.com/en/java/javase/11/docs/api" />
    346335            <doctitle><![CDATA[<h2>
    347336                <img src="https://josm.openstreetmap.de/svn/trunk/nodist/images/logo/header.png" style="vertical-align: middle;" alt="JOSM">
     
    351340            <!-- Disable HTML checking until we switch to Java13+, see https://bugs.openjdk.java.net/browse/JDK-8223552 -->
    352341            <arg value="-Xdoclint:-html" if:set="isJava13" />
    353             <arg value="-html5" if:set="isJava9" />
    354             <arg value="--add-exports" if:set="isJava9" unless:set="noJavaFX" />
    355             <arg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" if:set="isJava9" unless:set="noJavaFX" />
     342            <arg value="-html5" />
     343            <arg value="--add-exports" unless:set="noJavaFX" />
     344            <arg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" unless:set="noJavaFX" />
    356345        </javadoc>
    357346    </target>
     
    468457                        <jvmarg value="-Djunit.jupiter.extensions.autodetection.enabled=true"/>
    469458                        <jvmarg value="-Djunit.jupiter.execution.parallel.enabled=true"/>
    470                         <jvmarg value="--add-modules" if:set="isJava9" unless:set="isJava11" />
    471                         <jvmarg value="java.activation,java.se.ee" if:set="isJava9" unless:set="isJava11" />
    472                         <jvmarg value="--add-exports" if:set="isJava9" unless:set="noJavaFX" />
    473                         <jvmarg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" if:set="isJava9" unless:set="noJavaFX" />
    474                         <jvmarg value="--add-exports" if:set="isJava9" unless:set="isJava11" />
    475                         <jvmarg value="jdk.deploy/com.sun.deploy.config=ALL-UNNAMED" if:set="isJava9" unless:set="isJava11" />
    476                         <jvmarg value="--add-opens" if:set="isJava9" />
    477                         <jvmarg value="java.base/java.io=ALL-UNNAMED" if:set="isJava9" />
    478                         <jvmarg value="--add-opens" if:set="isJava9" />
    479                         <jvmarg value="java.base/java.lang=ALL-UNNAMED" if:set="isJava9" />
    480                         <jvmarg value="--add-opens" if:set="isJava9" />
    481                         <jvmarg value="java.base/java.nio=ALL-UNNAMED" if:set="isJava9" />
    482                         <jvmarg value="--add-opens" if:set="isJava9" />
    483                         <jvmarg value="java.base/java.text=ALL-UNNAMED" if:set="isJava9" />
    484                         <jvmarg value="--add-opens" if:set="isJava9" />
    485                         <jvmarg value="java.base/java.util=ALL-UNNAMED" if:set="isJava9" />
    486                         <jvmarg value="--add-opens" if:set="isJava9" />
    487                         <jvmarg value="java.base/jdk.internal.loader=ALL-UNNAMED" if:set="isJava9" />
    488                         <jvmarg value="--add-opens" if:set="isJava9" />
    489                         <jvmarg value="java.desktop/java.awt=ALL-UNNAMED" if:set="isJava9" />
    490                         <jvmarg value="--add-opens" if:set="isJava9" />
    491                         <jvmarg value="java.prefs/java.util.prefs=ALL-UNNAMED" if:set="isJava9" />
     459                        <jvmarg value="--add-exports" unless:set="noJavaFX" />
     460                        <jvmarg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" unless:set="noJavaFX" />
     461                        <jvmarg value="--add-opens" />
     462                        <jvmarg value="java.base/java.io=ALL-UNNAMED" />
     463                        <jvmarg value="--add-opens" />
     464                        <jvmarg value="java.base/java.lang=ALL-UNNAMED" />
     465                        <jvmarg value="--add-opens" />
     466                        <jvmarg value="java.base/java.nio=ALL-UNNAMED" />
     467                        <jvmarg value="--add-opens" />
     468                        <jvmarg value="java.base/java.text=ALL-UNNAMED" />
     469                        <jvmarg value="--add-opens" />
     470                        <jvmarg value="java.base/java.util=ALL-UNNAMED" />
     471                        <jvmarg value="--add-opens" />
     472                        <jvmarg value="java.base/jdk.internal.loader=ALL-UNNAMED" />
     473                        <jvmarg value="--add-opens" />
     474                        <jvmarg value="java.desktop/java.awt=ALL-UNNAMED" />
     475                        <jvmarg value="--add-opens" />
     476                        <jvmarg value="java.prefs/java.util.prefs=ALL-UNNAMED" />
    492477                        <sysproperty key="josm.home" value="${test.dir}/config/@{testfamily}-josm.home"/>
    493478                        <sysproperty key="josm.test.data" value="${test.dir}/data"/>
     
    713698            <path>
    714699                <fileset file="${dist-optimized.jar}"/>
    715                 <fileset file="${java.home}/lib/rt.jar" unless:set="isJava9"/>
    716                 <fileset file="${java.home}/lib/jce.jar" unless:set="isJava9"/>
    717                 <fileset file="${java.home}/lib/ext/jfxrt.jar" unless:set="isJava9"/>
    718                 <fileset dir="${java.home}/jmods" if:set="isJava9"/>
    719                 <fileset dir="/usr/share/openjfx/lib" unless:set="isJava9"/>
     700                <fileset dir="${java.home}/jmods" />
    720701            </path>
    721702        </as:build-signatures>
Note: See TracChangeset for help on using the changeset viewer.