From 8b9cd9875650e7150287169372fe3c30afedc37b Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 15 Oct 2024 13:27:56 +0200 Subject: [PATCH] [build-logic] Remove some isJavaXCompatible blocks Since Smack requires now Java 11, all conditional code for lower Java versions can be dropped from the build logic. --- ...ltime.smack.java-common-conventions.gradle | 23 +------------- ...erealtime.smack.javadoc-conventions.gradle | 30 ++++++++----------- 2 files changed, 13 insertions(+), 40 deletions(-) diff --git a/build-logic/src/main/groovy/org.igniterealtime.smack.java-common-conventions.gradle b/build-logic/src/main/groovy/org.igniterealtime.smack.java-common-conventions.gradle index 598fdfa67..12e4455b8 100644 --- a/build-logic/src/main/groovy/org.igniterealtime.smack.java-common-conventions.gradle +++ b/build-logic/src/main/groovy/org.igniterealtime.smack.java-common-conventions.gradle @@ -89,28 +89,7 @@ tasks.withType(JavaCompile) { '-Xlint:-serial', '-Werror', ] -} -if (JavaVersion.current().isJava8Compatible()) { - tasks.withType(Javadoc) { - // The '-quiet' as second argument is actually a hack, - // since the one parameter addStringOption doesn't seem to - // work, we extra add '-quiet', which is added anyway by - // gradle. - // We disable 'missing' as we do most of javadoc checking via checkstyle. - options.addStringOption('Xdoclint:all,-missing', '-quiet') - // Abort on javadoc warnings. - // See JDK-8200363 (https://bugs.openjdk.java.net/browse/JDK-8200363) - // for information about the -Xwerror option. - options.addStringOption('Xwerror', '-quiet') - } -} - -if (JavaVersion.current().isJava9Compatible()) { - tasks.withType(JavaCompile) { - options.compilerArgs.addAll([ - '--release', javaMajor, - ]) - } + options.release = Integer.valueOf(javaMajor) } jacoco { diff --git a/build-logic/src/main/groovy/org.igniterealtime.smack.javadoc-conventions.gradle b/build-logic/src/main/groovy/org.igniterealtime.smack.javadoc-conventions.gradle index 61cb8f3c6..34bf7a682 100644 --- a/build-logic/src/main/groovy/org.igniterealtime.smack.javadoc-conventions.gradle +++ b/build-logic/src/main/groovy/org.igniterealtime.smack.javadoc-conventions.gradle @@ -4,25 +4,19 @@ plugins { id 'org.igniterealtime.smack.global-conventions' } -if (JavaVersion.current().isJava8Compatible()) { - tasks.withType(Javadoc) { - // The '-quiet' as second argument is actually a hack, - // since the one parameter addStringOption doesn't seem to - // work, we extra add '-quiet', which is added anyway by - // gradle. - // We disable 'missing' as we do most of javadoc checking via checkstyle. - options.addStringOption('Xdoclint:all,-missing', '-quiet') - // Abort on javadoc warnings. - // See JDK-8200363 (https://bugs.openjdk.java.net/browse/JDK-8200363) - // for information about the -Xwerror option. - options.addStringOption('Xwerror', '-quiet') - } -} -if (JavaVersion.current().isJava9Compatible()) { - tasks.withType(Javadoc) { - options.addStringOption('-release', javaMajor) - } +tasks.withType(Javadoc) { + // The '-quiet' as second argument is actually a hack, + // since the one parameter addStringOption doesn't seem to + // work, we extra add '-quiet', which is added anyway by + // gradle. + // We disable 'missing' as we do most of javadoc checking via checkstyle. + options.addStringOption('Xdoclint:all,-missing', '-quiet') + // Abort on javadoc warnings. + // See JDK-8200363 (https://bugs.openjdk.java.net/browse/JDK-8200363) + // for information about the -Xwerror option. + options.addStringOption('Xwerror', '-quiet') + options.addStringOption('-release', javaMajor) } tasks.withType(Javadoc) {