Skip to content

Commit

Permalink
LUCENE-9490: skip checkMissingDocsDefault on runtime Java > 14.
Browse files Browse the repository at this point in the history
  • Loading branch information
dweiss committed Aug 29, 2020
1 parent a57ba25 commit 346dde3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions gradle/testing/alternative-jdk-support.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down
13 changes: 12 additions & 1 deletion gradle/validation/missing-docs-check.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 346dde3

Please sign in to comment.