diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/MessyTestPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/MessyTestPlugin.groovy index 69e63da3fcc..1c0aec1bc00 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/MessyTestPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/MessyTestPlugin.groovy @@ -57,7 +57,7 @@ class MessyTestPlugin extends StandaloneTestPlugin { project.sourceSets.test.output.dir(outputDir, builtBy: taskName) // add each generated dir to the test classpath in IDEs - //project.eclipse.classpath.sourceSets = [project.sourceSets.test] project.idea.module.singleEntryLibraries= ['TEST': [project.file(outputDir)]] + // Eclipse doesn't need this because it gets the entire module as a dependency } } diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/TestWithDependenciesPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/TestWithDependenciesPlugin.groovy index afb3f203d94..7e370fd69e2 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/TestWithDependenciesPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/TestWithDependenciesPlugin.groovy @@ -29,13 +29,21 @@ import org.gradle.api.tasks.Copy /** * A plugin to run tests that depend on other plugins or modules. * - * This plugin will add the plugin-metadata and properties files for each + * This plugin will add the plugin-metadata and properties files for each * dependency to the test source set. */ class TestWithDependenciesPlugin implements Plugin { @Override void apply(Project project) { + if (project.isEclipse) { + /* The changes this plugin makes both break and aren't needed by + * Eclipse. This is because Eclipse flattens main and test + * dependencies into a single dependency. Because Eclipse is + * "special".... */ + return + } + project.configurations.testCompile.dependencies.all { Dependency dep -> // this closure is run every time a compile dependency is added if (dep instanceof ProjectDependency && dep.dependencyProject.plugins.hasPlugin(PluginBuildPlugin)) {