@Override public String getDisplayName() { return CompositeFileCollection.this.getDisplayName(); } };
@Override public String toString() { return CompositeFileCollection.this.toString() + " dependencies"; }
public void visitDependencies(TaskDependencyResolveContext context) { CompositeFileCollection.this.visitDependencies(context); } };
@Override protected void addAsResourceCollection(Object builder, String nodeName) { for (FileCollection fileCollection : getSourceCollections()) { fileCollection.addToAntBuilder(builder, nodeName, AntType.ResourceCollection); } }
@Override public void visitDependencies(TaskDependencyResolveContext context) { BuildDependenciesOnlyFileCollectionResolveContext fileContext = new BuildDependenciesOnlyFileCollectionResolveContext(context); visitContents(fileContext); }
@Override protected Collection<DirectoryFileTree> getAsFileTrees() { List<DirectoryFileTree> fileTree = new ArrayList<DirectoryFileTree>(); for (FileCollection source : getSourceCollections()) { AbstractFileCollection collection = (AbstractFileCollection) source; fileTree.addAll(collection.getAsFileTrees()); } return fileTree; }
@Override public void visitContents(FileCollectionResolveContext context) { ResolvableFileCollectionResolveContext nested = context.newContext(); CompositeFileCollection.this.visitContents(nested); context.add(nested.resolveAsFileTrees()); }
@Override public boolean contains(File file) { for (FileCollection collection : getSourceCollections()) { if (collection.contains(file)) { return true; } } return false; }
@Override public void visitDependencies(TaskDependencyResolveContext context) { CompositeFileCollection.this.visitDependencies(context); }
protected Collection<? extends FileCollectionInternal> getSourceCollections() { DefaultFileCollectionResolveContext context = new DefaultFileCollectionResolveContext(new IdentityFileResolver()); visitContents(context); return context.resolveAsFileCollections(); }
@Override public String getDisplayName() { return CompositeFileCollection.this.getDisplayName(); } };
@Override public boolean isEmpty() { for (FileCollection collection : getSourceCollections()) { if (!collection.isEmpty()) { return false; } } return true; }
@Override public void visitDependencies(TaskDependencyResolveContext context) { CompositeFileCollection.this.visitDependencies(context); }
@Override public void registerWatchPoints(FileSystemSubset.Builder builder) { for (FileCollectionInternal files : getSourceCollections()) { files.registerWatchPoints(builder); } }
@Override public void visitDependencies(TaskDependencyResolveContext context) { context.add(buildDependencies); super.visitDependencies(context); } }
@Override public void visitRootElements(FileCollectionVisitor visitor) { for (FileCollectionInternal element : getSourceCollections()) { element.visitRootElements(visitor); } } }
@Override public void visitDependencies(TaskDependencyResolveContext context) { context.add(buildDependency); super.visitDependencies(context); } }
protected Collection<? extends FileTreeInternal> getSourceCollections() { return Cast.uncheckedCast(super.getSourceCollections()); }
public Set<File> getFiles() { // Gather each of the backing Sets first, so we can set the initial capacity of the LinkedHashSet List<Set<File>> fileSets = new LinkedList<Set<File>>(); int fileCount = 0; for (FileCollection collection : getSourceCollections()) { Set<File> files = collection.getFiles(); fileCount += files.size(); fileSets.add(files); } Set<File> allFiles = new LinkedHashSet<File>(fileCount); for (Set<File> fileSet : fileSets) { allFiles.addAll(fileSet); } return allFiles; }
@Override public void visitContents(FileCollectionResolveContext context) { for (FileCollection collection : CompositeFileCollection.this.getSourceCollections()) { context.add(collection.filter(filterSpec)); } }