Merge pull request #15087 from rjernst/standalone_tests_intellij

Setup standalone tests to compile in intellij
This commit is contained in:
Ryan Ernst 2015-12-07 16:02:49 -08:00
commit ce78c2b280
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -46,6 +46,8 @@ public class StandaloneTestBasePlugin implements Plugin<Project> {
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)