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) {