diff --git a/build.gradle b/build.gradle index aba92c253..2351b9065 100644 --- a/build.gradle +++ b/build.gradle @@ -97,31 +97,34 @@ if (file('.git').exists()) { // Exclude everything under the directory that git should be ignoring via .gitignore or that isn't checked in. These // restrict us only to files that are checked in or are staged. def repo = Grgit.open(currentDir: project.getRootDir()) - excludes = new ArrayList(repo.clean(ignore: false, directories: true, dryRun: true)) - // And some of the files that we have checked in should also be excluded from this check - excludes.addAll([ - '.*\\.asc', - '\\w+/out/.*', - 'eth-reference-tests/**', - 'build', - '.*/build/**', - '.editorconfig', - '.idea/**', - 'gradlew.bat', - 'gradlew', - 'io/src/test/resources/org/apache/tuweni/io/file/**', - 'toml/src/test/resources/**', - '.gitattributes', - 'test1.txt', - 'test2.txt', - 'test3.yaml', - '.*\\.kotlin_module', - 'example-v0.4.0.toml', - 'hard_example.toml', - 'toml-v0.5.0-spec-example.toml', - 'test.txt', - 'resourceresolver-test.jar' - ]) + excludes = { + def list = new ArrayList(repo.clean(ignore: false, directories: true, dryRun: true)) + // And some of the files that we have checked in should also be excluded from this check + list.addAll([ + '.*\\.asc', + '\\w+/out/.*', + 'eth-reference-tests/**', + 'build', + '.*/build/**', + '.editorconfig', + '.idea/**', + 'gradlew.bat', + 'gradlew', + 'io/src/test/resources/org/apache/tuweni/io/file/**', + 'toml/src/test/resources/**', + '.gitattributes', + 'test1.txt', + 'test2.txt', + 'test3.yaml', + '.*\\.kotlin_module', + 'example-v0.4.0.toml', + 'hard_example.toml', + 'toml-v0.5.0-spec-example.toml', + 'test.txt', + 'resourceresolver-test.jar' + ]) + return list + } } } diff --git a/gradle/rat.gradle b/gradle/rat.gradle index 8679584b3..070797eec 100644 --- a/gradle/rat.gradle +++ b/gradle/rat.gradle @@ -27,7 +27,7 @@ apply plugin: RatPlugin class RatTask extends DefaultTask { @Input - List excludes + Closure> excludes def reportDir = project.file('build/rat') def stylesheet = project.file('gradle/resources/rat-output-to-html.xsl').getAbsolutePath() @@ -35,6 +35,7 @@ class RatTask extends DefaultTask { def htmlReport = new File(reportDir, 'rat-report.html') def generateXmlReport(File reportDir) { + def excludeList = excludes() def antBuilder = services.get(IsolatedAntBuilder) def ratClasspath = project.configurations.rat def projectPath = project.getRootDir().getAbsolutePath() @@ -43,7 +44,7 @@ class RatTask extends DefaultTask { ant.report(format: 'xml', reportFile: xmlReport) { fileset(dir: projectPath) { patternset { - excludes.each { exclude(name: it) } + excludeList.each { exclude(name: it) } } } }