This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 97ef1b5866 don't create checkstyle report task for empty java source
tree
97ef1b5866 is described below
commit 97ef1b5866124bfc7aaaac3160e1a264f8b4cc7b
Author: Paul King <[email protected]>
AuthorDate: Sun May 18 21:24:28 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 c95012f9d9..16518ad300 100644
--- a/build-logic/src/main/groovy/org.apache.groovy-base.gradle
+++ b/build-logic/src/main/groovy/org.apache.groovy-base.gradle
@@ -268,13 +268,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")
+ }
}
}
}