Skip to content

Commit

Permalink
see #605
Browse files Browse the repository at this point in the history
  • Loading branch information
larsgrefer committed Oct 18, 2022
1 parent 3002715 commit 45bd440
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.file.FileCollection;
import org.gradle.api.file.SourceDirectorySet;
import org.gradle.api.internal.plugins.DslObject;
import org.gradle.api.plugins.JavaBasePlugin;
Expand Down Expand Up @@ -64,7 +65,10 @@ private void configureSourceSet(SourceSet sourceSet) {
final SourceDirectorySet aspectjSource = AspectjSourceSet.getAspectj(sourceSet);
aspectjSource.srcDir("src/" + sourceSet.getName() + "/aspectj");

sourceSet.getResources().getFilter().exclude(element -> AspectjSourceSet.getAspectj(sourceSet).contains(element.getFile()));
// Explicitly capture only a FileCollection in the lambda below for compatibility with configuration-cache.
//noinspection UnnecessaryLocalVariable
FileCollection aspectjSourceFileCollection = aspectjSource;
sourceSet.getResources().getFilter().exclude(element -> aspectjSourceFileCollection.contains(element.getFile()));
sourceSet.getAllJava().source(aspectjSource);
sourceSet.getAllSource().source(aspectjSource);

Expand Down

0 comments on commit 45bd440

Please sign in to comment.