Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
sambsnyd committed Sep 23, 2023
1 parent 2553b54 commit da10e29
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private static StringBuilder repeat(int repeat) {

public Collection<Path> listSources() {
// Use a sorted collection so that gradle input detection isn't thrown off by ordering
Set<Path> result = new TreeSet<>(omniParser(emptySet()).build().acceptedPaths(baseDir, project.getProjectDir().toPath()));
Set<Path> result = new TreeSet<>(omniParser(emptySet()).acceptedPaths(baseDir, project.getProjectDir().toPath()));
//noinspection deprecation
JavaPluginConvention javaConvention = project.getConvention().findPlugin(JavaPluginConvention.class);
if (javaConvention != null) {
Expand Down Expand Up @@ -806,7 +806,7 @@ public Stream<SourceFile> parse(Project subproject, Set<Path> alreadyParsed, Exe

for (File resourcesDir : sourceSet.getResources().getSourceDirectories()) {
if (resourcesDir.exists()) {
OmniParser omniParser = omniParser(alreadyParsed).build();
OmniParser omniParser = omniParser(alreadyParsed);
List<Path> accepted = omniParser.acceptedPaths(baseDir, resourcesDir.toPath());
sourceSetSourceFiles = Stream.concat(
sourceSetSourceFiles,
Expand Down Expand Up @@ -939,14 +939,13 @@ private SourceFileStream parseGradleFiles(

protected SourceFileStream parseNonProjectResources(Project subproject, Set<Path> alreadyParsed, ExecutionContext ctx, List<Marker> projectProvenance, Stream<SourceFile> sourceFiles) {
//Collect any additional yaml/properties/xml files that are NOT already in a source set.
OmniParser omniParser = omniParser(alreadyParsed)
.build();
OmniParser omniParser = omniParser(alreadyParsed);
List<Path> accepted = omniParser.acceptedPaths(baseDir, subproject.getProjectDir().toPath());
return SourceFileStream.build("", s -> {})
.concat(omniParser.parse(accepted, baseDir, ctx), accepted.size());
}

private OmniParser.Builder omniParser(Set<Path> alreadyParsed) {
private OmniParser omniParser(Set<Path> alreadyParsed) {
return OmniParser.builder(
OmniParser.RESOURCE_PARSERS,
PlainTextParser.builder()
Expand All @@ -956,7 +955,8 @@ private OmniParser.Builder omniParser(Set<Path> alreadyParsed) {
)
.exclusionMatchers(pathMatchers(baseDir, mergeExclusions(project, baseDir, extension)))
.exclusions(alreadyParsed)
.sizeThresholdMb(extension.getSizeThresholdMb());
.sizeThresholdMb(extension.getSizeThresholdMb())
.build();
}

private static Collection<String> mergeExclusions(Project project, Path baseDir, RewriteExtension extension) {
Expand Down

0 comments on commit da10e29

Please sign in to comment.