Skip to content

Commit

Permalink
[MCOMPILER-540] - useIncrementalCompilation=false may add generated s…
Browse files Browse the repository at this point in the history
…ources to the sources list
  • Loading branch information
mensinda committed Jun 16, 2023
1 parent 3ea742c commit d63feea
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,7 @@ public void execute() throws MojoExecutionException, CompilationFailureException
return;
}

staleSources = filterSourceFiles(staleSources);
compilerConfiguration.setSourceFiles(staleSources);

try {
Expand Down Expand Up @@ -1793,6 +1794,17 @@ public void setRelease(String release) {
targetOrReleaseSet = true;
}

private Set<File> filterSourceFiles(Set<File> sourceFiles) {
final File generatedSources = getGeneratedSourcesDirectory();
if (generatedSources == null) {
return sourceFiles;
}
final String generatedSourcesPath = generatedSources.getAbsolutePath();
return sourceFiles.stream()
.filter(x -> !x.getAbsolutePath().startsWith(generatedSourcesPath))
.collect(Collectors.toSet());
}

final String getImplicit() {
return implicit;
}
Expand Down

0 comments on commit d63feea

Please sign in to comment.