@Inject public OkBuckTask( OkBuckExtension okBuckExtension, KotlinExtension kotlinExtension, ScalaExtension scalaExtension, BuckFileManager buckFileManager) { this.okBuckExtension = okBuckExtension; this.kotlinExtension = kotlinExtension; this.scalaExtension = scalaExtension; this.buckFileManager = buckFileManager; // Never up to date; this task isn't safe to run incrementally. getOutputs().upToDateWhen(Specs.satisfyNone()); }
public CollectionFilter(Class<T> type) { this(type, Specs.<T>satisfyAll()); }
private static <T> Spec<T> doUnion(Collection<? extends Spec<? super T>> specs) { List<Spec<? super T>> filtered = new ArrayList<Spec<? super T>>(specs.size()); for (Spec<? super T> spec : specs) { if (spec == SATISFIES_ALL) { return satisfyAll(); } if (spec != SATISFIES_NONE) { filtered.add(spec); } } if (filtered.size() == 0) { return satisfyNone(); } if (filtered.size() == 1) { return Cast.uncheckedCast(filtered.get(0)); } return new OrSpec<T>(filtered); }
/** * Returns a spec that selects the intersection of those items selected by the given specs. Returns a spec that selects everything when no specs provided. */ public static <T> Spec<T> intersect(Collection<? extends Spec<? super T>> specs) { if (specs.size() == 0) { return satisfyAll(); } return doIntersect(specs); }
/** * Returns a spec that selects the union of those items selected by the provided spec. Selects everything when no specs provided. */ public static <T> Spec<T> union(Collection<? extends Spec<? super T>> specs) { if (specs.size() == 0) { return satisfyAll(); } return doUnion(specs); }
@Override public TaskCollection<T> matching(Closure spec) { return matching(Specs.<T>convertClosureToSpec(spec)); }
@SuppressWarnings("unchecked") public <S extends T> CollectionFilter<S> and(CollectionFilter<S> other) { return new CollectionFilter<S>(other.type, Specs.intersect(spec, other.spec)); } }
/** * Finds projects in the included builds. You have to run `gradlew eclipse` before running `gradle ide` for this to work, because * it relies on pre-existing `.project` files to determine the paths to subprojects. * * Supports root projects and subprojects, but not subsubprojects. */ public void findProjectsInIncludedBuilds() { findProjectsInIncludedBuilds(Specs.satisfyAll()); }
private static <T> Spec<T> doIntersect(Collection<? extends Spec<? super T>> specs) { List<Spec<? super T>> filtered = new ArrayList<Spec<? super T>>(specs.size()); for (Spec<? super T> spec : specs) { if (spec == SATISFIES_NONE) { return satisfyNone(); } if (spec != SATISFIES_ALL) { filtered.add(spec); } } if (filtered.size() == 0) { return satisfyAll(); } if (filtered.size() == 1) { return Cast.uncheckedCast(filtered.get(0)); } return new AndSpec<T>(filtered); }
/** * Returns a spec that selects the intersection of those items selected by the given specs. Returns a spec that selects everything when no specs provided. */ public static <T> Spec<T> intersect(Spec<? super T>... specs) { if (specs.length == 0) { return satisfyAll(); } if (specs.length == 1) { return Cast.uncheckedCast(specs[0]); } return doIntersect(Arrays.asList(specs)); }
/** * Returns a spec that selects the union of those items selected by the provided spec. Selects everything when no specs provided. */ public static <T> Spec<T> union(Spec<? super T>... specs) { if (specs.length == 0) { return satisfyAll(); } if (specs.length == 1) { return Cast.uncheckedCast(specs[0]); } return doUnion(Arrays.asList(specs)); }
public FileCollection filter(Closure filterClosure) { return filter(Specs.convertClosureToSpec(filterClosure)); }
public <S extends T> CollectionEventRegister<S> filtered(CollectionFilter<S> filter) { return delegate.filtered(new CollectionFilter<S>(filter.getType(), Specs.intersect(filter, this.filter))); } }
public static <T> NodeInitializerContext<T> forType(ModelType<T> type) { return new NodeInitializerContext<T>(type, Specs.<ModelType<?>>satisfyAll(), Optional.<PropertyContext>absent()); }
/** * Returns a spec that selects everything that is not selected by the given spec. */ public static <T> Spec<T> negate(Spec<? super T> spec) { if (spec == SATISFIES_ALL) { return satisfyNone(); } if (spec == SATISFIES_NONE) { return satisfyAll(); } if (spec instanceof NotSpec) { NotSpec<? super T> notSpec = (NotSpec<? super T>) spec; return Cast.uncheckedCast(notSpec.getSourceSpec()); } return new NotSpec<T>(spec); }
public SingleIncludePatternFileTree(File baseDir, String includePattern) { this(baseDir, includePattern, Specs.<FileTreeElement>satisfyNone()); }
@Override public NamedDomainObjectSet<T> matching(Closure spec) { return matching(Specs.<T>convertClosureToSpec(spec)); }
public void configure(BuildExecutionContext context) { GradleInternal gradle = context.getGradle(); Set<String> excludedTaskNames = gradle.getStartParameter().getExcludedTaskNames(); if (!excludedTaskNames.isEmpty()) { final Set<Spec<Task>> filters = new HashSet<Spec<Task>>(); for (String taskName : excludedTaskNames) { filters.add(taskSelector.getFilter(taskName)); } gradle.getTaskGraph().useFilter(Specs.intersect(filters)); } context.proceed(); } }
/** Adds all eclipse projects from all gradle projects. */ public void addAllProjects() { addAllProjects(Specs.satisfyAll()); }
public Validate() { super(); getOutputs().upToDateWhen(Specs.satisfyNone()); }