This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/GROOVY_4_0_X by this push:
new 04200ce3ed don't create checkstyle report task for empty java source
tree
04200ce3ed is described below
commit 04200ce3ed326a9ff44152b0d0aff8cf937da76f
Author: Paul King <[email protected]>
AuthorDate: Sun May 18 21:26:39 2025 +1000
don't create checkstyle report task for empty java source tree
---
.../src/main/groovy/org.apache.groovy-base.gradle | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/build-logic/src/main/groovy/org.apache.groovy-base.gradle
b/build-logic/src/main/groovy/org.apache.groovy-base.gradle
index f8d300a8a3..4ac02d979b 100644
--- a/build-logic/src/main/groovy/org.apache.groovy-base.gradle
+++ b/build-logic/src/main/groovy/org.apache.groovy-base.gradle
@@ -267,13 +267,15 @@ tasks.withType(Checkstyle).configureEach {chk ->
}
}
finalizedBy {
- // we use a closure here as a workaround, to preserve task
configuration laziness
- tasks.register("${name}Report", CheckstyleHtmlReport) {
- dependsOn chk
- source.from(chk.source)
- configFile =
rootProject.file('config/checkstyle/checkstyle-report.groovy')
- checkstyleReportFile = reportFile
- outputFile =
layout.buildDirectory.file("reports/checkstyle/${chk.name}.html")
+ if (chk.source.size()) {
+ // we use a closure here as a workaround, to preserve task
configuration laziness
+ tasks.register("${name}Report", CheckstyleHtmlReport) {
+ dependsOn chk
+ source.from(chk.source)
+ configFile =
rootProject.file('config/checkstyle/checkstyle-report.groovy')
+ checkstyleReportFile = reportFile
+ outputFile =
layout.buildDirectory.file("reports/checkstyle/${chk.name}.html")
+ }
}
}
}