From ca9bec7c1aa1a2627bd1d92d2c5c64ae54a746d6 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Thu, 7 May 2020 13:30:07 -0400 Subject: [PATCH] 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 --- .../java/org/elasticsearch/gradle/util/GradleUtils.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/util/GradleUtils.java b/buildSrc/src/main/java/org/elasticsearch/gradle/util/GradleUtils.java index 21dfe3120d1..84acea79327 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/util/GradleUtils.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/util/GradleUtils.java @@ -41,6 +41,7 @@ import org.gradle.api.tasks.testing.Test; 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; @@ -170,7 +171,12 @@ public abstract class GradleUtils { }); project.getPluginManager().withPlugin("eclipse", p -> { EclipseModel eclipse = project.getExtensions().getByType(EclipseModel.class); - eclipse.getClasspath().setSourceSets(List.of(testSourceSet)); + List eclipseSourceSets = new ArrayList<>(); + for (SourceSet old : eclipse.getClasspath().getSourceSets()) { + eclipseSourceSets.add(old); + } + eclipseSourceSets.add(testSourceSet); + eclipse.getClasspath().setSourceSets(sourceSets); eclipse.getClasspath().getPlusConfigurations().add(runtimeClasspathConfiguration); });