From 14df77295de3a646189d2885b1f15128591eb236 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Mon, 31 Aug 2020 02:09:13 +0200 Subject: [PATCH] LUCENE-9490: Disable both tasks in :lucene:core on Java 15+ --- gradle/validation/missing-docs-check.gradle | 25 ++++++++++++--------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/gradle/validation/missing-docs-check.gradle b/gradle/validation/missing-docs-check.gradle index 57399ecdd8d..c0ee56ed04b 100644 --- a/gradle/validation/missing-docs-check.gradle +++ b/gradle/validation/missing-docs-check.gradle @@ -14,6 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +def javaVersionCheck = { + 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 + } +} allprojects { plugins.withType(JavaPlugin) { @@ -37,17 +49,7 @@ 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 - } - } + onlyIf javaVersionCheck // TODO: add missing docs for all classes and bump this to level=class if (project.path.startsWith(":solr")) { @@ -72,6 +74,7 @@ configure(project(':lucene:core')) { // Defer until java plugin has been applied, otherwise we can't resolve project.javadoc. plugins.withType(JavaPlugin) { task checkMissingDocsMethod(type: CheckMissingDocsTask, dependsOn: 'renderJavadoc') { + onlyIf javaVersionCheck level = 'method' }