Java 类org.gradle.api.tasks.SkipWhenEmpty 实例源码

项目:Reer    文件:AbstractInputPropertyAnnotationHandler.java   
public void attachActions(final TaskPropertyActionContext context) {
    context.setValidationAction(new ValidationAction() {
        @Override
        public void validate(String propertyName, Object value, Collection<String> messages) {
            AbstractInputPropertyAnnotationHandler.this.validate(propertyName, value, messages);
        }
    });
    context.setConfigureAction(new UpdateAction() {
        public void update(TaskInternal task, Callable<Object> futureValue) {
            final TaskInputFilePropertyBuilder propertyBuilder = createPropertyBuilder(context, task, futureValue);
            propertyBuilder
                .withPropertyName(context.getName())
                .withPathSensitivity(getPathSensitivity(context))
                .skipWhenEmpty(context.isAnnotationPresent(SkipWhenEmpty.class))
                .optional(context.isOptional());
            handleOrderSensitive(propertyBuilder, context);
        }
    });
}
项目:Reer    文件:JDepend.java   
/**
 * The directory containing the classes to be analyzed.
 */
@PathSensitive(PathSensitivity.RELATIVE)
@InputDirectory
@SkipWhenEmpty
public File getClassesDir() {
    return classesDir;
}
项目:Reer    文件:FindBugs.java   
/**
 * The classes to be analyzed.
 */
@SkipWhenEmpty
@PathSensitive(PathSensitivity.RELATIVE)
@InputFiles
public FileCollection getClasses() {
    return classes;
}
项目:Reer    文件:AntlrTask.java   
/**
 * Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist.
 *
 * @return The source.
 */
// This method is here as the Gradle DSL generation can't handle properties with setters and getters in different classes.
@InputFiles
@SkipWhenEmpty
public FileTree getSource() {
    return super.getSource();
}
项目:Reer    文件:ValidateTaskProperties.java   
/**
 * The directory containing the classes to validate.
 */
@PathSensitive(PathSensitivity.RELATIVE)
@InputDirectory
@SkipWhenEmpty
public File getClassesDir() {
    return classesDir;
}
项目:Reer    文件:TestReport.java   
/**
 * 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;
}
项目:Pushjet-Android    文件:InputFilesPropertyAnnotationHandler.java   
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);
            }
        }
    });
}
项目:Pushjet-Android    文件:InputDirectoryPropertyAnnotationHandler.java   
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);
            }
        }
    });
}
项目:Pushjet-Android    文件:TestReport.java   
/**
 * 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;
}
项目:Pushjet-Android    文件:InputFilesPropertyAnnotationHandler.java   
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);
            }
        }
    });
}
项目:Pushjet-Android    文件:InputDirectoryPropertyAnnotationHandler.java   
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);
            }
        }
    });
}
项目:Pushjet-Android    文件:TestReport.java   
/**
 * 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;
}
项目:javaccPlugin    文件:AbstractJavaccTask.java   
@InputDirectory
@SkipWhenEmpty
@PathSensitive(PathSensitivity.NONE)
@Optional
public File getInputDirectory() {
    if (!inputDirectory.exists()) {
        return null;
    } else {
        return inputDirectory;
    }
}
项目:Reer    文件:CreateStaticLibrary.java   
/**
 * The source object files to be passed to the archiver.
 */
@InputFiles
@SkipWhenEmpty
public FileCollection getSource() {
    return source;
}
项目:Reer    文件:Assemble.java   
@InputFiles
@SkipWhenEmpty
public FileCollection getSource() {
    return source;
}
项目:forbidden-apis    文件:CheckForbiddenApis.java   
/** Returns the classes to check. */
@InputFiles
@SkipWhenEmpty
public FileTree getClassFiles() {
  return getClassesDirs().getAsFileTree().matching(getPatternSet());
}
项目:JGiven    文件:JGivenReportTask.java   
@InputDirectory
@SkipWhenEmpty
@PathSensitive( PathSensitivity.NONE )
public File getResults() {
    return results;
}