Search in sources :

Example 1 with MinimalFileTree

use of org.gradle.api.internal.file.collections.MinimalFileTree in project gradle by gradle.

the class SyncCopyActionDecorator method execute.

@Override
public WorkResult execute(final CopyActionProcessingStream stream) {
    final Set<RelativePath> visited = new HashSet<>();
    WorkResult didWork = delegate.execute(action -> stream.process(details -> {
        visited.add(details.getRelativePath());
        action.processFile(details);
    }));
    SyncCopyActionDecoratorFileVisitor fileVisitor = new SyncCopyActionDecoratorFileVisitor(visited, preserveSpec, deleter);
    MinimalFileTree walker = directoryFileTreeFactory.create(baseDestDir).postfix();
    walker.visit(fileVisitor);
    visited.clear();
    return WorkResults.didWork(didWork.getDidWork() || fileVisitor.didWork);
}
Also used : PatternFilterable(org.gradle.api.tasks.util.PatternFilterable) FileVisitDetails(org.gradle.api.file.FileVisitDetails) PatternSet(org.gradle.api.tasks.util.PatternSet) Set(java.util.Set) IOException(java.io.IOException) WorkResult(org.gradle.api.tasks.WorkResult) File(java.io.File) WorkResults(org.gradle.api.tasks.WorkResults) UncheckedIOException(java.io.UncheckedIOException) HashSet(java.util.HashSet) Deleter(org.gradle.internal.file.Deleter) RelativePath(org.gradle.api.file.RelativePath) Spec(org.gradle.api.specs.Spec) DirectoryFileTreeFactory(org.gradle.api.internal.file.collections.DirectoryFileTreeFactory) FileTreeElement(org.gradle.api.file.FileTreeElement) MinimalFileTree(org.gradle.api.internal.file.collections.MinimalFileTree) FileVisitor(org.gradle.api.file.FileVisitor) Nullable(javax.annotation.Nullable) RelativePath(org.gradle.api.file.RelativePath) WorkResult(org.gradle.api.tasks.WorkResult) MinimalFileTree(org.gradle.api.internal.file.collections.MinimalFileTree) HashSet(java.util.HashSet)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 UncheckedIOException (java.io.UncheckedIOException)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1 Nullable (javax.annotation.Nullable)1 FileTreeElement (org.gradle.api.file.FileTreeElement)1 FileVisitDetails (org.gradle.api.file.FileVisitDetails)1 FileVisitor (org.gradle.api.file.FileVisitor)1 RelativePath (org.gradle.api.file.RelativePath)1 DirectoryFileTreeFactory (org.gradle.api.internal.file.collections.DirectoryFileTreeFactory)1 MinimalFileTree (org.gradle.api.internal.file.collections.MinimalFileTree)1 Spec (org.gradle.api.specs.Spec)1 WorkResult (org.gradle.api.tasks.WorkResult)1 WorkResults (org.gradle.api.tasks.WorkResults)1 PatternFilterable (org.gradle.api.tasks.util.PatternFilterable)1 PatternSet (org.gradle.api.tasks.util.PatternSet)1 Deleter (org.gradle.internal.file.Deleter)1