Skip to content

Commit

Permalink
Mark all inputs appropriately (compatible with Gradle 7)
Browse files Browse the repository at this point in the history
Merges GH-12 and resolves GH-13.
  • Loading branch information
WildCard65 authored and jamierocks committed May 10, 2020
1 parent 238cb9d commit 4941065
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,26 @@ package org.cadixdev.gradle.licenser.tasks

import org.cadixdev.gradle.licenser.LicenseViolationException
import org.gradle.api.file.FileVisitDetails
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.VerificationTask

class LicenseCheck extends LicenseTask implements VerificationTask {

boolean ignoreFailures
// We can't use a Groovy property, as it would produce 2 getters to
// satisfy VerificationTask - which Gradle doesn't like.
private boolean _ignoreFailures

@Input
@Override
boolean getIgnoreFailures() {
return this._ignoreFailures
}

@Override
void setIgnoreFailures(boolean value) {
this._ignoreFailures = value
}

@TaskAction
void checkFiles() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import org.gradle.api.file.FileTree
import org.gradle.api.file.FileTreeElement
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.SkipWhenEmpty
import org.gradle.api.tasks.util.PatternFilterable

Expand All @@ -40,14 +41,17 @@ class LicenseTask extends DefaultTask {
@Input
List<Header> headers

@InputFiles
@SkipWhenEmpty
@Internal
FileCollection files

@Input
PatternFilterable filter

@Input
String charset

@InputFiles
@SkipWhenEmpty
FileTree getMatchingFiles() {
def tree = this.files.asFileTree
return filter != null ? tree.matching(filter) : tree
Expand Down

0 comments on commit 4941065

Please sign in to comment.