@@ -683,15 +683,8 @@ class ScipBuildTool(index: IndexCommand) extends BuildTool("SCIP", index) {
683
683
Files .walkFileTree(targetroot, new DeleteVisitor )
684
684
}
685
685
686
- /** Recursively collects all Java files in the working directory */
687
- private def collectAllSourceFiles (config : Config , dir : Path ): List [Path ] = {
688
- if (config.sourceFiles.nonEmpty) {
689
- return config
690
- .sourceFiles
691
- .map(path => AbsolutePath .of(Paths .get(path), dir))
692
- .filter(path => Files .isRegularFile(path))
693
- }
694
- val buf = ListBuffer .empty[Path ]
686
+ private def collectAllSourceFiles (dir : Path ) = {
687
+ val buf = List .newBuilder[Path ]
695
688
Files .walkFileTree(
696
689
dir,
697
690
new SimpleFileVisitor [Path ] {
@@ -719,7 +712,27 @@ class ScipBuildTool(index: IndexCommand) extends BuildTool("SCIP", index) {
719
712
): FileVisitResult = FileVisitResult .CONTINUE
720
713
}
721
714
)
722
- buf.toList
715
+ buf.result()
716
+ }
717
+
718
+ /** Recursively collects all Java files in the working directory */
719
+ private def collectAllSourceFiles (config : Config , dir : Path ): List [Path ] = {
720
+ if (config.sourceFiles.nonEmpty) {
721
+ println(config.sourceFiles)
722
+ config
723
+ .sourceFiles
724
+ .flatMap { relativePath =>
725
+ val path = AbsolutePath .of(Paths .get(relativePath), dir)
726
+
727
+ if (Files .isRegularFile(path) && allPatterns.matches(path))
728
+ List (path)
729
+ else if (Files .isDirectory(path))
730
+ collectAllSourceFiles(path)
731
+ else
732
+ Nil
733
+ }
734
+ } else
735
+ collectAllSourceFiles(dir)
723
736
}
724
737
725
738
// HACK(olafurpg): I haven't figured out a reliable way to get annotation processor jars on the processorpath.
0 commit comments