use of org.gradle.api.file.FileVisitDetails 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.FileVisitDetails 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