use of org.gradle.api.internal.file.FileCollectionVisitor in project gradle by gradle.
the class CacheBackedTaskHistoryRepository method getDeclaredOutputFilePaths.
private static ImmutableSet<String> getDeclaredOutputFilePaths(final TaskProperties taskProperties, final StringInterner stringInterner) {
final ImmutableSet.Builder<String> declaredOutputFilePaths = ImmutableSortedSet.naturalOrder();
FileCollectionInternal outputFiles = (FileCollectionInternal) taskProperties.getOutputFiles();
outputFiles.visitRootElements(new FileCollectionVisitor() {
@Override
public void visitCollection(FileCollectionInternal fileCollection) {
addAllPaths(fileCollection, declaredOutputFilePaths, stringInterner);
}
@Override
public void visitTree(FileTreeInternal fileTree) {
DeprecationLogger.nagUserOfDeprecated("Adding file trees which are not directory trees as output files");
addAllPaths(fileTree, declaredOutputFilePaths, stringInterner);
}
@Override
public void visitDirectoryTree(DirectoryFileTree directoryTree) {
addPath(directoryTree.getDir(), declaredOutputFilePaths, stringInterner);
}
});
return declaredOutputFilePaths.build();
}
Aggregations