Skip to content

Commit

Permalink
Build: fix eclipse after icTests (#56362)
Browse files Browse the repository at this point in the history
We made a small mistake when breaking out the `ESIntegTestCase`
subclasses that confused eclipse. This makes it happy again. Poor
eclipse!

Relates #55896
  • Loading branch information
nik9000 committed May 7, 2020
1 parent 9c1a112 commit 691ee6d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.gradle.plugins.ide.eclipse.model.EclipseModel;
import org.gradle.plugins.ide.idea.model.IdeaModel;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -170,7 +171,12 @@ public static TaskProvider<?> addTestSourceSet(Project project, String sourceSet
});
project.getPluginManager().withPlugin("eclipse", p -> {
EclipseModel eclipse = project.getExtensions().getByType(EclipseModel.class);
eclipse.getClasspath().setSourceSets(List.of(testSourceSet));
List<SourceSet> eclipseSourceSets = new ArrayList<>();
for (SourceSet old : eclipse.getClasspath().getSourceSets()) {
eclipseSourceSets.add(old);
}
eclipseSourceSets.add(testSourceSet);
eclipse.getClasspath().setSourceSets(sourceSets);
eclipse.getClasspath().getPlusConfigurations().add(runtimeClasspathConfiguration);
});

Expand Down

0 comments on commit 691ee6d

Please sign in to comment.