Skip to content

Commit

Permalink
SourceFileCollector: return SourceFiles ordered by fully qualified cl…
Browse files Browse the repository at this point in the history
…ass name
  • Loading branch information
fmck3516 committed Nov 26, 2023
1 parent 3aad756 commit f477af6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

import java.io.File;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

import static java.util.Comparator.comparing;

public class SourceFileCollector {

public static List<SourceFile> getAllSources(Project project) {
Expand All @@ -16,7 +19,7 @@ public static List<SourceFile> getAllSources(Project project) {
for (SourceSet sourceSet : sourceSetContainer) {
result.addAll(getSourceFiles(sourceSet));
}
return result;
return result.stream().sorted(comparing(SourceFile::getFullyQualifiedClassName)).toList();
}

private static List<SourceFile> getSourceFiles(SourceSet sourceSet) {
Expand Down

0 comments on commit f477af6

Please sign in to comment.