org.gradle.api.tasks.SkipWhenEmpty Java Examples

The following examples show how to use org.gradle.api.tasks.SkipWhenEmpty. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: InputDirectoryPropertyAnnotationHandler.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void attachActions(PropertyActionContext context) {
    context.setValidationAction(inputDirValidation);
    final boolean isSourceDir = context.getTarget().getAnnotation(SkipWhenEmpty.class) != null;
    context.setConfigureAction(new UpdateAction() {
        public void update(Task task, Callable<Object> futureValue) {
            if (isSourceDir) {
                task.getInputs().sourceDir(futureValue);
            } else {
                task.getInputs().dir(futureValue);
            }
        }
    });
}
 
Example #2
Source File: AbstractJavaccTask.java    From javaccPlugin with MIT License 5 votes vote down vote up
@InputDirectory
@SkipWhenEmpty
@PathSensitive(PathSensitivity.NONE)
@Optional
public File getInputDirectory() {
    if (!inputDirectory.exists()) {
        return null;
    } else {
        return inputDirectory;
    }
}
 
Example #3
Source File: Cpd.java    From gradle-cpd-plugin with Apache License 2.0 5 votes vote down vote up
@Override
@InputFiles
@SkipWhenEmpty
@PathSensitive(PathSensitivity.RELATIVE)
public FileTree getSource() {
    return super.getSource();
}
 
Example #4
Source File: TestReport.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Returns the set of binary test results to include in the report.
 */
@InputFiles @SkipWhenEmpty
public FileCollection getTestResultDirs() {
    UnionFileCollection dirs = new UnionFileCollection();
    for (Object result : results) {
        addTo(result, dirs);
    }
    return dirs;
}
 
Example #5
Source File: InputDirectoryPropertyAnnotationHandler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void attachActions(PropertyActionContext context) {
    context.setValidationAction(inputDirValidation);
    final boolean isSourceDir = context.getTarget().getAnnotation(SkipWhenEmpty.class) != null;
    context.setConfigureAction(new UpdateAction() {
        public void update(Task task, Callable<Object> futureValue) {
            if (isSourceDir) {
                task.getInputs().sourceDir(futureValue);
            } else {
                task.getInputs().dir(futureValue);
            }
        }
    });
}
 
Example #6
Source File: InputFilesPropertyAnnotationHandler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void attachActions(PropertyActionContext context) {
    final boolean isSourceFiles = context.getTarget().getAnnotation(SkipWhenEmpty.class) != null;
    context.setConfigureAction(new UpdateAction() {
        public void update(Task task, Callable<Object> futureValue) {
            if (isSourceFiles) {
                task.getInputs().source(futureValue);
            } else {
                task.getInputs().files(futureValue);
            }
        }
    });
}
 
Example #7
Source File: TestReport.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Returns the set of binary test results to include in the report.
 */
@InputFiles @SkipWhenEmpty
public FileCollection getTestResultDirs() {
    UnionFileCollection dirs = new UnionFileCollection();
    for (Object result : results) {
        addTo(result, dirs);
    }
    return dirs;
}
 
Example #8
Source File: InputDirectoryPropertyAnnotationHandler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void attachActions(PropertyActionContext context) {
    context.setValidationAction(inputDirValidation);
    final boolean isSourceDir = context.getTarget().getAnnotation(SkipWhenEmpty.class) != null;
    context.setConfigureAction(new UpdateAction() {
        public void update(Task task, Callable<Object> futureValue) {
            if (isSourceDir) {
                task.getInputs().sourceDir(futureValue);
            } else {
                task.getInputs().dir(futureValue);
            }
        }
    });
}
 
Example #9
Source File: InputFilesPropertyAnnotationHandler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void attachActions(PropertyActionContext context) {
    final boolean isSourceFiles = context.getTarget().getAnnotation(SkipWhenEmpty.class) != null;
    context.setConfigureAction(new UpdateAction() {
        public void update(Task task, Callable<Object> futureValue) {
            if (isSourceFiles) {
                task.getInputs().source(futureValue);
            } else {
                task.getInputs().files(futureValue);
            }
        }
    });
}
 
Example #10
Source File: TestReport.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Returns the set of binary test results to include in the report.
 */
@InputFiles @SkipWhenEmpty
public FileCollection getTestResultDirs() {
    UnionFileCollection dirs = new UnionFileCollection();
    for (Object result : results) {
        addTo(result, dirs);
    }
    return dirs;
}
 
Example #11
Source File: InputDirectoryPropertyAnnotationHandler.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void attachActions(PropertyActionContext context) {
    context.setValidationAction(inputDirValidation);
    final boolean isSourceDir = context.getTarget().getAnnotation(SkipWhenEmpty.class) != null;
    context.setConfigureAction(new UpdateAction() {
        public void update(Task task, Callable<Object> futureValue) {
            if (isSourceDir) {
                task.getInputs().sourceDir(futureValue);
            } else {
                task.getInputs().dir(futureValue);
            }
        }
    });
}
 
Example #12
Source File: InputFilesPropertyAnnotationHandler.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void attachActions(PropertyActionContext context) {
    final boolean isSourceFiles = context.getTarget().getAnnotation(SkipWhenEmpty.class) != null;
    context.setConfigureAction(new UpdateAction() {
        public void update(Task task, Callable<Object> futureValue) {
            if (isSourceFiles) {
                task.getInputs().source(futureValue);
            } else {
                task.getInputs().files(futureValue);
            }
        }
    });
}
 
Example #13
Source File: TestReport.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Returns the set of binary test results to include in the report.
 */
@InputFiles @SkipWhenEmpty
public FileCollection getTestResultDirs() {
    UnionFileCollection dirs = new UnionFileCollection();
    for (Object result : results) {
        addTo(result, dirs);
    }
    return dirs;
}
 
Example #14
Source File: InputFilesPropertyAnnotationHandler.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void attachActions(PropertyActionContext context) {
    final boolean isSourceFiles = context.getTarget().getAnnotation(SkipWhenEmpty.class) != null;
    context.setConfigureAction(new UpdateAction() {
        public void update(Task task, Callable<Object> futureValue) {
            if (isSourceFiles) {
                task.getInputs().source(futureValue);
            } else {
                task.getInputs().files(futureValue);
            }
        }
    });
}
 
Example #15
Source File: ClojureCheck.java    From clojurephant with Apache License 2.0 4 votes vote down vote up
@InputFiles
@SkipWhenEmpty
public FileCollection getSource() {
  return Namespaces.getSources(sourceRoots, Namespaces.CLOJURE_EXTENSIONS);
}
 
Example #16
Source File: CheckForbiddenApis.java    From forbidden-apis with Apache License 2.0 4 votes vote down vote up
/** Returns the classes to check. */
@InputFiles
@SkipWhenEmpty
public FileTree getClassFiles() {
  return getClassesDirs().getAsFileTree().matching(getPatternSet());
}
 
Example #17
Source File: ProcessSvnDiggerFiles.java    From zap-extensions with Apache License 2.0 4 votes vote down vote up
@InputFiles
@SkipWhenEmpty
public ConfigurableFileTree getSourceFiles() {
    return sourceFiles;
}
 
Example #18
Source File: ClojureCompile.java    From clojurephant with Apache License 2.0 4 votes vote down vote up
@InputFiles
@SkipWhenEmpty
public FileTree getSource() {
  return Namespaces.getSources(sourceRoots, Namespaces.CLOJURE_EXTENSIONS);
}
 
Example #19
Source File: ClojureScriptCompile.java    From clojurephant with Apache License 2.0 4 votes vote down vote up
@InputFiles
@SkipWhenEmpty
public FileCollection getSource() {
  return Namespaces.getSources(sourceRoots, Namespaces.CLOJURESCRIPT_EXTENSIONS);
}
 
Example #20
Source File: GlobClean.java    From commerce-gradle-plugin with Apache License 2.0 4 votes vote down vote up
@SkipWhenEmpty
@InputDirectory
public DirectoryProperty getBaseFolder() {
    return baseFolder;
}
 
Example #21
Source File: JGivenReportTask.java    From JGiven with Apache License 2.0 4 votes vote down vote up
@InputDirectory
@SkipWhenEmpty
@PathSensitive(PathSensitivity.NONE)
public File getResults() {
    return results;
}