From 4440b56d2a986249bfe1f02b905f176ba944d5ce Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sat, 4 Apr 2020 21:45:26 +0300 Subject: [PATCH] Fix Gradle task annotations --- .../forbiddenapis/gradle/CheckForbiddenApis.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/thetaphi/forbiddenapis/gradle/CheckForbiddenApis.java b/src/main/java/de/thetaphi/forbiddenapis/gradle/CheckForbiddenApis.java index 94880a39..88b402dd 100644 --- a/src/main/java/de/thetaphi/forbiddenapis/gradle/CheckForbiddenApis.java +++ b/src/main/java/de/thetaphi/forbiddenapis/gradle/CheckForbiddenApis.java @@ -43,6 +43,7 @@ import org.gradle.api.specs.Spec; import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputFiles; +import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.Optional; import org.gradle.api.tasks.OutputDirectories; import org.gradle.api.tasks.ParallelizableTask; @@ -123,8 +124,8 @@ public class CheckForbiddenApis extends DefaultTask implements PatternFilterable * Directories with the class files to check. * Defaults to current sourseSet's output directory (Gradle 2/3) or output directories (Gradle 4.0+). */ - @OutputDirectories // no @InputDirectories, we use separate getter for a list of all input files + @Internal public FileCollection getClassesDirs() { return classesDirs; } @@ -143,6 +144,7 @@ public void setClassesDirs(FileCollection classesDirs) { * throw an exception! */ @Deprecated + @Internal public File getClassesDir() { final FileCollection col = getClassesDirs(); return (col == null) ? null : col.getSingleFile(); @@ -161,6 +163,7 @@ public void setClassesDir(File classesDir) { } /** Returns the pattern set to match against class files in {@link #getClassesDir()}. */ + @Internal public PatternSet getPatternSet() { return patternSet; } @@ -406,7 +409,7 @@ public void setTargetCompatibility(String targetCompatibility) { * The default is a single include with pattern '**/*.class' */ @Override - @Input + @Internal public Set getIncludes() { return getPatternSet().getIncludes(); } @@ -423,7 +426,7 @@ public CheckForbiddenApis setIncludes(Iterable includes) { * Set of patterns matching class files to be excluded from checking. */ @Override - @Input + @Internal public Set getExcludes() { return getPatternSet().getExcludes(); }