diff --git a/gradle/testing/alternative-jdk-support.gradle b/gradle/testing/alternative-jdk-support.gradle index 1e692910095..f864b64628b 100644 --- a/gradle/testing/alternative-jdk-support.gradle +++ b/gradle/testing/alternative-jdk-support.gradle @@ -32,6 +32,9 @@ JavaInstallation altJvm = { } }() +// Set up root project's property. +rootProject.ext.runtimeJava = altJvm + if (!currentJvm.javaExecutable.equals(altJvm.javaExecutable)) { // Set up java toolchain tasks to use the alternative Java. // This is a related Gradle issue for the future: @@ -63,6 +66,7 @@ if (!currentJvm.javaExecutable.equals(altJvm.javaExecutable)) { options.forkOptions.javaHome = altJvm.installationDirectory.asFile } + // Javadoc compilation. def javadocExecutable = altJvm.jdk.get().javadocExecutable.asFile tasks.matching { it.name == "renderJavadoc" || it.name == "renderSiteJavadoc" }.all { dependsOn ":altJvmWarning" diff --git a/gradle/validation/missing-docs-check.gradle b/gradle/validation/missing-docs-check.gradle index e9cb6aefd8f..2b24e791258 100644 --- a/gradle/validation/missing-docs-check.gradle +++ b/gradle/validation/missing-docs-check.gradle @@ -37,6 +37,18 @@ allprojects { task checkMissingDocsDefault(type: CheckMissingDocsTask, dependsOn: 'renderJavadoc') { dirs += [ project.javadoc.destinationDir ] + onlyIf { + def maxSupported = JavaVersion.VERSION_14 + def runtimeVersion = runtimeJava.javaVersion + if (runtimeVersion > JavaVersion.VERSION_14) { + logger.warn("Skipping task because runtime Java version ${runtimeVersion} is " + + "higher than Java ${maxSupported}.") + return false + } else { + return true + } + } + // TODO: add missing docs for all classes and bump this to level=class if (project.path.startsWith(":solr")) { level = 'package' @@ -72,7 +84,6 @@ configure(project(':lucene:core')) { "org/apache/lucene/index", "org/apache/lucene/codecs" ].collect { path -> file("${project.javadoc.destinationDir}/${path}") } - checkMissingDocs { dependsOn checkMissingDocsMethod }