Skip to content

Commit

Permalink
Detect JDK9+ by presence of jmod
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaroslav Tulach committed Jan 2, 2019
1 parent 3354ccf commit 4b857cc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ matrix:
- env: SIGTEST=true COMPILETEST=false RAT=false EOL=true LICENSE=false CV=true RUN_TESTS_JDK8=false RUN_JAVA_TESTS=false
jdk: oraclejdk8

- env: OPTS="-quiet -Dpermit.jdk9.builds=true -Dvanilla.javac.exists=true" TARGET="build-platform"
- env: OPTS="-quiet" TARGET="build-platform"
jdk: oraclejdk11

- env: SIGTEST=false COMPILETEST=false RAT=false EOL=false LICENSE=false CV=false RUN_TESTS_JDK9PLUS=false RUN_TESTS_JDK8=true TEST_MODULES="java/java.completion" OPTS="-Dcluster.config=java -quiet build -Djavac.compilerargs=-nowarn -Dbuild.compiler.deprecation=false"
Expand Down
7 changes: 6 additions & 1 deletion nbbuild/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
<fail message="You need JDK 8+ to build NetBeans; nbjdk.home=${nbjdk.home} java.home=${java.home}">
<condition>
<not>
<isset property="have-jdk-1.8"/>
<or>
<isset property="have-jdk-1.8"/>
<isset property="have-jdk-1.9"/>
</or>
</not>
</condition>
</fail>
Expand Down Expand Up @@ -451,6 +454,8 @@ Hg ID: ${hg.id}
<mkdir dir="${netbeans.dest.dir}"/>
<ant dir="." target="-build-platform" inheritAll="false">
<property name="cluster.config" value="platform"/>
<property name="permit.jdk9.builds" value="true"/>
<property name="vanilla.javac.exists" value="true"/>
</ant>
</target>

Expand Down
7 changes: 5 additions & 2 deletions nbbuild/jdk.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,18 @@
<available file="${nbjdk.javac}" type="file"/>
<available file="${nbjdk.java}" type="file"/>
<available file="${nbjdk.javadoc}" type="file"/>
<available classname="java.lang.Object" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
<or>
<available classname="java.lang.Object" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
<available file="${nbjdk.home}/bin/jmod"/>
</or>
</and>
</condition>
<available property="have-jdk-1.4" classname="java.lang.CharSequence" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
<available property="have-jdk-1.5" classname="java.lang.StringBuilder" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
<available property="have-jdk-1.6" classname="java.util.ServiceLoader" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
<available property="have-jdk-1.7" classname="java.lang.ReflectiveOperationException" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
<available property="have-jdk-1.8" classname="java.lang.FunctionalInterface" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
<available property="have-jdk-1.9" classname="java.util.zip.CRC32C" classpath="${nbjdk.bootclasspath}" ignoresystemclasses="true"/>
<available property="have-jdk-1.9" file="${nbjdk.home}/bin/jmod"/>
<echo level="verbose">nbjdk.active=${nbjdk.active} nbjdk.home=${nbjdk.home} nbjdk.java=${nbjdk.java} nbjdk.javac=${nbjdk.javac} nbjdk.javadoc=${nbjdk.javadoc} nbjdk.bootclasspath=${nbjdk.bootclasspath} nbjdk.valid=${nbjdk.valid} have-jdk-1.4=${have-jdk-1.4} have-jdk-1.5=${have-jdk-1.5} have-jdk-1.6=${have-jdk-1.6} have-jdk-1.7=${have-jdk-1.7} have-jdk-1.8=${have-jdk-1.8} have-jdk-1.9=${have-jdk-1.9}</echo>
</target>

Expand Down
2 changes: 2 additions & 0 deletions nbi/engine/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@
<target name="probe" depends="init">
<available property="probe.javac.source" value="1.6" classname="java.lang.Module"/>
<available property="probe.javac.target" value="1.6" classname="java.lang.Module"/>
<available property="probe.javac.source" value="1.6" file="${nbjdk.home}/bin/jmod"/>
<available property="probe.javac.target" value="1.6" file="${nbjdk.home}/bin/jmod"/>
<property name="probe.javac.source" value="1.3"/>
<property name="probe.javac.target" value="1.1"/>
<mkdir dir="${build.classes.dir}/org/netbeans/installer/utils/applications/"/>
Expand Down
4 changes: 3 additions & 1 deletion platform/applemenu/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
<mkdir dir="${build.dir}/desktop-classes-src" />
<unzip src="external/applemenu-external-desktop-classes-8.2.zip" dest="${build.dir}/desktop-classes-src"/>
<mkdir dir="${build.dir}/desktop-classes-classes" />
<javac srcdir="${build.dir}/desktop-classes-src" destdir="${build.dir}/desktop-classes-classes" />
<javac srcdir="${build.dir}/desktop-classes-src" destdir="${build.dir}/desktop-classes-classes"
source="1.8" target="1.8">
</javac>
</target>

</project>

0 comments on commit 4b857cc

Please sign in to comment.