From 26eb84a3b5ebe83f8ec94d0896ec7261340269ad Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Tue, 24 Aug 2021 13:13:26 +0200 Subject: [PATCH] Fix immutable properties. Fix ant uri namespace no longer working (seems like gradle regression). --- gradle/validation/rat-sources.gradle | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gradle/validation/rat-sources.gradle b/gradle/validation/rat-sources.gradle index 96a57c81e93..0f9dff1059e 100644 --- a/gradle/validation/rat-sources.gradle +++ b/gradle/validation/rat-sources.gradle @@ -126,18 +126,16 @@ allprojects { */ class RatTask extends DefaultTask { @InputFiles - ListProperty inputFileTrees = project.objects.listProperty(ConfigurableFileTree) + final ListProperty inputFileTrees = project.objects.listProperty(ConfigurableFileTree) @OutputFile - RegularFileProperty xmlReport = project.objects.fileProperty().convention( + final RegularFileProperty xmlReport = project.objects.fileProperty().convention( project.layout.buildDirectory.file("rat/rat-report.xml")) def generateReport(File reportFile) { // Set up ant rat task. - def uri = 'antlib:org.apache.rat.anttasks' def ratClasspath = project.rootProject.configurations.ratDeps.asPath - ant.taskdef(resource: 'org/apache/rat/anttasks/antlib.xml', uri: uri, classpath: ratClasspath) - def rat = NamespaceBuilder.newInstance(ant, uri) + ant.taskdef(resource: 'org/apache/rat/anttasks/antlib.xml', classpath: ratClasspath) // Collect all output files for debugging. String inputFileList = inputFileTrees.get().collectMany { fileTree -> @@ -146,7 +144,7 @@ class RatTask extends DefaultTask { project.file(reportFile.path.replaceAll('.xml$', '-filelist.txt')).setText(inputFileList, "UTF-8") // Run rat via ant. - rat.report(format: 'xml', reportFile: reportFile, addDefaultLicenseMatchers: true) { + ant.report(format: 'xml', reportFile: reportFile, addDefaultLicenseMatchers: true) { // Pass all gradle file trees to the ant task (Gradle's internal adapters are used). inputFileTrees.get().each { fileTree -> fileTree.addToAntBuilder(ant, 'resources', FileCollection.AntType.ResourceCollection)