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); } }); }
/** * The directory containing the classes to be analyzed. */ @PathSensitive(PathSensitivity.RELATIVE) @InputDirectory @SkipWhenEmpty public File getClassesDir() { return classesDir; }
/** * The classes to be analyzed. */ @SkipWhenEmpty @PathSensitive(PathSensitivity.RELATIVE) @InputFiles public FileCollection getClasses() { return classes; }
/** * 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(); }
/** * The directory containing the classes to validate. */ @PathSensitive(PathSensitivity.RELATIVE) @InputDirectory @SkipWhenEmpty public File getClassesDir() { return classesDir; }
/** * 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; }
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); } } }); }
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); } } }); }
@InputDirectory @SkipWhenEmpty @PathSensitive(PathSensitivity.NONE) @Optional public File getInputDirectory() { if (!inputDirectory.exists()) { return null; } else { return inputDirectory; } }
/** * The source object files to be passed to the archiver. */ @InputFiles @SkipWhenEmpty public FileCollection getSource() { return source; }
@InputFiles @SkipWhenEmpty public FileCollection getSource() { return source; }
/** Returns the classes to check. */ @InputFiles @SkipWhenEmpty public FileTree getClassFiles() { return getClassesDirs().getAsFileTree().matching(getPatternSet()); }
@InputDirectory @SkipWhenEmpty @PathSensitive( PathSensitivity.NONE ) public File getResults() { return results; }