diff --git a/build.gradle b/build.gradle index dac8232b172..878f7a9a915 100644 --- a/build.gradle +++ b/build.gradle @@ -184,6 +184,12 @@ tasks.idea.doLast { if (System.getProperty('idea.active') != null && ideaMarker.exists() == false) { throw new GradleException('You must run gradle idea from the root of elasticsearch before importing into IntelliJ') } +// add buildSrc itself as a groovy project +task buildSrcIdea(type: GradleBuild) { + buildFile = 'buildSrc/build.gradle' + tasks = ['cleanIdea', 'ideaModule'] +} +tasks.idea.dependsOn(buildSrcIdea) // eclipse configuration diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneTestBasePlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneTestBasePlugin.groovy index 8c3b5f754cc..f317254cd45 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneTestBasePlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneTestBasePlugin.groovy @@ -46,6 +46,8 @@ public class StandaloneTestBasePlugin implements Plugin { project.eclipse.classpath.sourceSets = [project.sourceSets.test] project.eclipse.classpath.plusConfigurations = [project.configurations.testRuntime] + project.idea.module.testSourceDirs += project.sourceSets.test.java.srcDirs + project.idea.module.scopes['TEST'] = [plus: [project.configurations.testRuntime]] PrecommitTasks.create(project, false) project.check.dependsOn(project.precommit)