From 00c697780e852d92ca16e0cf129143ea7e18b9c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Fri, 24 May 2019 10:50:02 +0200 Subject: [PATCH] HHH-13415 Clean up the places where we fix fix javadoc generation for JDK11 --- documentation/documentation.gradle | 8 +++----- gradle/published-java-module.gradle | 7 +++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/documentation/documentation.gradle b/documentation/documentation.gradle index ff3f2d5db4..1978df362f 100644 --- a/documentation/documentation.gradle +++ b/documentation/documentation.gradle @@ -128,17 +128,15 @@ task aggregateJavadocs(type: Javadoc) { 'http://docs.jboss.org/cdi/api/2.0/', 'https://javaee.github.io/javaee-spec/javadocs/' ] - - //Workaround to get the JVM version while ignoring the Gradle Enums for versions, - //as they never support upcoming JVM versions (doesn't have a isJava12Compatible() yet ) + if ( JavaVersion.current().isJava11Compatible() ) { - //The need to set `--source 8` applies to all JVMs after 11, and also to 11 + //The need to set `--source 1.8` applies to all JVMs after 11, and also to 11 // but after excluding the first two builds; see also specific comments on // https://bugs.openjdk.java.net/browse/JDK-8212233?focusedCommentId=14245762 // For now, let's be compatible with JDK 11.0.3+. We can improve on it if people // complain they cannot build with JDK 11.0.0, 11.0.1 and 11.0.2. System.out.println("Forcing Javadoc in Java 8 compatible mode"); - options.addStringOption('source', '8') + options.source = project.baselineJavaVersion } if ( JavaVersion.current().isJava8Compatible() ) { diff --git a/gradle/published-java-module.gradle b/gradle/published-java-module.gradle index 65c26351af..ac9043be27 100644 --- a/gradle/published-java-module.gradle +++ b/gradle/published-java-module.gradle @@ -98,16 +98,15 @@ javadoc { 'http://docs.jboss.org/cdi/api/2.0/', 'https://javaee.github.io/javaee-spec/javadocs/' ] - //Workaround to get the JVM version while ignoring the Gradle Enums for versions, - //as they never support upcoming JVM versions (doesn't have a isJava12Compatible() yet ) + if ( JavaVersion.current().isJava11Compatible() ) { - //The need to set `--source 8` applies to all JVMs after 11, and also to 11 + //The need to set `--source 1.8` applies to all JVMs after 11, and also to 11 // but after excluding the first two builds; see also specific comments on // https://bugs.openjdk.java.net/browse/JDK-8212233?focusedCommentId=14245762 // For now, let's be compatible with JDK 11.0.3+. We can improve on it if people // complain they cannot build with JDK 11.0.0, 11.0.1 and 11.0.2. System.out.println("Forcing Javadoc in Java 8 compatible mode"); - options.addStringOption('source', '8') + options.source = project.baselineJavaVersion } if ( JavaVersion.current().isJava8Compatible() ) {