You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2023/08/01 05:56:24 UTC

[groovy] branch master updated: something became stricter and projects without Java source files now failing check - make more lenient

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 c488230d4d something became stricter and projects without Java source files now failing check - make more lenient
c488230d4d is described below

commit c488230d4d25d3f3482bbf7f0a0b5440c8d30263
Author: Paul King <pa...@asert.com.au>
AuthorDate: Tue Aug 1 15:56:12 2023 +1000

    something became stricter and projects without Java source files now failing check - make more lenient
---
 .../groovy/org/apache/groovy/gradle/CheckstyleHtmlReport.groovy     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/build-logic/src/main/groovy/org/apache/groovy/gradle/CheckstyleHtmlReport.groovy b/build-logic/src/main/groovy/org/apache/groovy/gradle/CheckstyleHtmlReport.groovy
index d3210f330e..a27c576fd5 100644
--- a/build-logic/src/main/groovy/org/apache/groovy/gradle/CheckstyleHtmlReport.groovy
+++ b/build-logic/src/main/groovy/org/apache/groovy/gradle/CheckstyleHtmlReport.groovy
@@ -48,7 +48,8 @@ class CheckstyleHtmlReport extends DefaultTask {
     @PathSensitive(PathSensitivity.RELATIVE)
     final RegularFileProperty configFile = project.objects.fileProperty()
 
-    @InputFile
+    @InputFiles
+    @SkipWhenEmpty
     @PathSensitive(PathSensitivity.RELATIVE)
     final RegularFileProperty checkstyleReportFile = project.objects.fileProperty()
 
@@ -60,6 +61,7 @@ class CheckstyleHtmlReport extends DefaultTask {
         def configFile = this.configFile.get().asFile
         def configDir = configFile.parentFile
         def reportFile = checkstyleReportFile.get().asFile
+        if (!reportFile || !reportFile.exists()) return // @SkipWhenEmpty not working?
         def htmlReportFile = outputFile.get().asFile
         def templateConfiguration = new TemplateConfiguration()
         templateConfiguration.with {
@@ -68,7 +70,7 @@ class CheckstyleHtmlReport extends DefaultTask {
         }
         def engine = new MarkupTemplateEngine(this.class.classLoader, configDir, templateConfiguration)
         def xml = new XmlSlurper().parse(reportFile.newReader('utf-8'))
-       def model = buildModel(xml)
+        def model = buildModel(xml)
         htmlReportFile.parentFile.mkdirs()
         htmlReportFile.withWriter('utf-8') { wrt ->
             engine.createTemplateByPath('checkstyle-report.groovy').make(model).writeTo(wrt)