use of org.gradle.api.file.EmptyFileVisitor in project gradle by gradle.
the class DefaultPathKeyFileStore method search.
@Override
public Set<? extends LocallyAvailableResource> search(String pattern) {
if (!getBaseDir().exists()) {
return Collections.emptySet();
}
final Set<LocallyAvailableResource> entries = new HashSet<LocallyAvailableResource>();
findFiles(pattern).visit(new EmptyFileVisitor() {
public void visitFile(FileVisitDetails fileDetails) {
final File file = fileDetails.getFile();
// the file system visitor stuff can't handle the file system mutating while visiting
if (!isInProgressMarkerFile(file) && !isInProgressFile(file)) {
entries.add(entryAt(file));
}
}
});
return entries;
}
use of org.gradle.api.file.EmptyFileVisitor in project gradle by gradle.
the class AbstractFileTree method getFiles.
public Set<File> getFiles() {
final Set<File> files = new LinkedHashSet<File>();
visit(new EmptyFileVisitor() {
public void visitFile(FileVisitDetails fileDetails) {
files.add(fileDetails.getFile());
}
});
return files;
}
use of org.gradle.api.file.EmptyFileVisitor in project gradle by gradle.
the class AbstractFileTree method getAsMap.
public Map<String, File> getAsMap() {
final Map<String, File> map = new LinkedHashMap<String, File>();
visit(new EmptyFileVisitor() {
public void visitFile(FileVisitDetails fileDetails) {
map.put(fileDetails.getRelativePath().getPathString(), fileDetails.getFile());
}
});
return map;
}
use of org.gradle.api.file.EmptyFileVisitor in project gradle by gradle.
the class PathKeyFileStore method search.
public Set<? extends LocallyAvailableResource> search(String pattern) {
if (!getBaseDir().exists()) {
return Collections.emptySet();
}
final Set<LocallyAvailableResource> entries = new HashSet<LocallyAvailableResource>();
findFiles(pattern).visit(new EmptyFileVisitor() {
public void visitFile(FileVisitDetails fileDetails) {
final File file = fileDetails.getFile();
// the file system visitor stuff can't handle the file system mutating while visiting
if (!isInProgressMarkerFile(file) && !isInProgressFile(file)) {
entries.add(entryAt(file));
}
}
});
return entries;
}
use of org.gradle.api.file.EmptyFileVisitor in project gradle by gradle.
the class IncrementalNativeCompiler method handleDiscoveredInputs.
protected void handleDiscoveredInputs(T spec, IncrementalCompilation compilation, final DiscoveredInputRecorder discoveredInputRecorder) {
for (File includeFile : compilation.getDiscoveredInputs()) {
discoveredInputRecorder.newInput(includeFile);
}
if (sourceFilesUseMacroIncludes(spec.getSourceFiles(), compilation.getFinalState())) {
LOGGER.info("After parsing the source files, Gradle cannot calculate the exact set of include files for {}. Every file in the include search path will be considered an input.", task.getName());
for (final File includeRoot : spec.getIncludeRoots()) {
LOGGER.info("adding files in {} to discovered inputs for {}", includeRoot, task.getName());
directoryFileTreeFactory.create(includeRoot).visit(new EmptyFileVisitor() {
@Override
public void visitFile(FileVisitDetails fileDetails) {
discoveredInputRecorder.newInput(fileDetails.getFile());
}
});
}
}
}
Aggregations