LUCENE-9490: skip checkMissingDocsDefault on runtime Java > 14.

This commit is contained in:
Dawid Weiss 2020-08-29 17:17:24 +02:00
parent a57ba25400
commit 346dde3395
2 changed files with 16 additions and 1 deletions

View File

@ -32,6 +32,9 @@ JavaInstallation altJvm = {
} }
}() }()
// Set up root project's property.
rootProject.ext.runtimeJava = altJvm
if (!currentJvm.javaExecutable.equals(altJvm.javaExecutable)) { if (!currentJvm.javaExecutable.equals(altJvm.javaExecutable)) {
// Set up java toolchain tasks to use the alternative Java. // Set up java toolchain tasks to use the alternative Java.
// This is a related Gradle issue for the future: // 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 options.forkOptions.javaHome = altJvm.installationDirectory.asFile
} }
// Javadoc compilation.
def javadocExecutable = altJvm.jdk.get().javadocExecutable.asFile def javadocExecutable = altJvm.jdk.get().javadocExecutable.asFile
tasks.matching { it.name == "renderJavadoc" || it.name == "renderSiteJavadoc" }.all { tasks.matching { it.name == "renderJavadoc" || it.name == "renderSiteJavadoc" }.all {
dependsOn ":altJvmWarning" dependsOn ":altJvmWarning"

View File

@ -37,6 +37,18 @@ allprojects {
task checkMissingDocsDefault(type: CheckMissingDocsTask, dependsOn: 'renderJavadoc') { task checkMissingDocsDefault(type: CheckMissingDocsTask, dependsOn: 'renderJavadoc') {
dirs += [ project.javadoc.destinationDir ] 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 // TODO: add missing docs for all classes and bump this to level=class
if (project.path.startsWith(":solr")) { if (project.path.startsWith(":solr")) {
level = 'package' level = 'package'
@ -72,7 +84,6 @@ configure(project(':lucene:core')) {
"org/apache/lucene/index", "org/apache/lucene/index",
"org/apache/lucene/codecs" "org/apache/lucene/codecs"
].collect { path -> file("${project.javadoc.destinationDir}/${path}") } ].collect { path -> file("${project.javadoc.destinationDir}/${path}") }
checkMissingDocs { checkMissingDocs {
dependsOn checkMissingDocsMethod dependsOn checkMissingDocsMethod
} }