From dad7610ecd6fbaecf3ac2e18979ea8157c8eee37 Mon Sep 17 00:00:00 2001 From: Vasilis Diakomanolis Date: Thu, 5 Jan 2023 16:34:36 +0200 Subject: [PATCH] Convert header & source path sensitivity to relative --- .../nl/javadude/gradle/plugins/license/License.groovy | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/groovy/nl/javadude/gradle/plugins/license/License.groovy b/src/main/groovy/nl/javadude/gradle/plugins/license/License.groovy index d7f0e89..732c60e 100644 --- a/src/main/groovy/nl/javadude/gradle/plugins/license/License.groovy +++ b/src/main/groovy/nl/javadude/gradle/plugins/license/License.groovy @@ -24,6 +24,7 @@ import nl.javadude.gradle.plugins.license.maven.LicenseFormatMojo import org.gradle.api.GradleException import org.gradle.api.NamedDomainObjectContainer import org.gradle.api.file.FileCollection +import org.gradle.api.file.FileTree import org.gradle.api.tasks.* import javax.inject.Inject @@ -73,6 +74,7 @@ class License extends SourceTask implements VerificationTask { @Optional @InputFile + @PathSensitive(PathSensitivity.RELATIVE) File header /** @@ -113,6 +115,14 @@ class License extends SourceTask implements VerificationTask { this.check = check } + @InputFiles + @SkipWhenEmpty + @IgnoreEmptyDirectories + @PathSensitive(PathSensitivity.RELATIVE) + public FileTree getSource() { + return this.sourceFiles.getAsFileTree().matching(this.patternSet); + } + @TaskAction protected void process() { // Plain weird, but this ensures that the lazy closure from the extension is properly wired into the excludes field of the SourceTask.