Skip to content

Commit

Permalink
better debugging and right ScanAction to skip excluded folders
Browse files Browse the repository at this point in the history
  • Loading branch information
rmannibucau committed Jun 9, 2020
1 parent aa3ff7a commit 0f1b162
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public ScanAction visitDirectory(final String name, final File directory) {
if (debugEnabled) {
log.debug("Skipping '" + new File(directory, name) + "' since it is excluded");
}
return ScanAction.ABORT_DIRECTORY;
return ScanAction.NO_RECURSE;
}
if (debugEnabled) {
log.debug("Visiting '" + new File(directory, name) + "' since it is not excluded");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
Expand Down Expand Up @@ -92,7 +93,20 @@ private String buildDebugMessage(DirectoryScanner scanner) {
"includedDirsFiles=" + asList(scanner.getIncludedDirectories()) + ",\n" +
"includedFiles=" + asList(scanner.getIncludedFiles()) + ",\n" +
"notIncludedDirs=" + asList(scanner.getNotIncludedDirectories()) + ",\n" +
"notIncludedFiles=" + asList(scanner.getNotIncludedFiles()) + ",\n";
"notIncludedFiles=" + asList(scanner.getNotIncludedFiles()) + ",\n" +
"diskFiles=" + listFiles(scanner.getBasedir(), new ArrayList<File>());
}

private Collection<File> listFiles(File basedir, Collection<File> files) {
files.add(basedir);
for (File f : basedir.listFiles()) {
if (f.isDirectory()) {
listFiles(f, files);
} else {
files.add(f);
}
}
return files;
}

private void assertIncludedFilesInFakeProject(Selection selection, String debugMessage) {
Expand Down

0 comments on commit 0f1b162

Please sign in to comment.