Skip to content

Commit

Permalink
Fail with doFirst
Browse files Browse the repository at this point in the history
  • Loading branch information
mizosoft committed Apr 16, 2024
1 parent 418ca91 commit 5975eb3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ val aggregateJavadoc by tasks.registering(Javadoc::class) {
)

// --module-source-path javadoc option is only supported on Java 12+.
onlyIf("aggregateJavadoc uses tool options that are available in Java 12 or higher.") {
java.toolchain.languageVersion.get() >= JavaLanguageVersion.of(12)
doFirst {
if (javadocTool.get().metadata.languageVersion <= JavaLanguageVersion.of(12)) {
throw GradleException("aggregateJavadoc uses tool options that are only available in Java 12 or higher.")
}
}
}

Expand Down

0 comments on commit 5975eb3

Please sign in to comment.