Build: fix eclipse after icTests (#56362)

We made a small mistake when breaking out the `ESIntegTestCase`
subclasses that confused eclipse. This makes it happy again. Poor
eclipse!

Relates #55896
This commit is contained in:
Nik Everett 2020-05-07 13:30:07 -04:00
parent d064eda2b0
commit ca9bec7c1a
1 changed files with 7 additions and 1 deletions

View File

@ -41,6 +41,7 @@ import org.gradle.api.tasks.testing.Test;
import org.gradle.plugins.ide.eclipse.model.EclipseModel; import org.gradle.plugins.ide.eclipse.model.EclipseModel;
import org.gradle.plugins.ide.idea.model.IdeaModel; import org.gradle.plugins.ide.idea.model.IdeaModel;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -170,7 +171,12 @@ public abstract class GradleUtils {
}); });
project.getPluginManager().withPlugin("eclipse", p -> { project.getPluginManager().withPlugin("eclipse", p -> {
EclipseModel eclipse = project.getExtensions().getByType(EclipseModel.class); 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); eclipse.getClasspath().getPlusConfigurations().add(runtimeClasspathConfiguration);
}); });