From 9bdc10802eec2ac600f97112ee4baf16bd550ac0 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Fri, 30 Oct 2015 11:39:31 -0400 Subject: [PATCH 1/2] Get eclipse working with gradle --- CONTRIBUTING.md | 2 +- build.gradle | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3e8e728696c..517cb153859 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,7 +76,7 @@ Contributing to the Elasticsearch codebase **Repository:** [https://github.com/elastic/elasticsearch](https://github.com/elastic/elasticsearch) -Make sure you have [Gradle](http://gradle.org) installed, as Elasticsearch uses it as its build system. Integration with IntelliJ and Eclipse should work out of the box. Eclipse users can automatically configure their IDE by running `gradle eclipse` and then importing the project into their workspace: `File > Import > Existing project into workspace` and make sure to select `Search for nested projects...` option as Elasticsearch is a multi-module maven project. Additionally you will want to ensure that Eclipse is using 2048m of heap by modifying `eclipse.ini` accordingly to avoid GC overhead errors. +Make sure you have [Gradle](http://gradle.org) installed, as Elasticsearch uses it as its build system. Integration with IntelliJ and Eclipse should work out of the box. Eclipse users can automatically configure their IDE: `File > Import -> Gradle -> Gradle project`. When the `Import Options` dialog is presented, add `-Declipse` to the JVM Options box. Additionally you will want to ensure that Eclipse is using 2048m of heap by modifying `eclipse.ini` accordingly to avoid GC overhead errors. Please follow these formatting guidelines: diff --git a/build.gradle b/build.gradle index 21090ce901d..3b104702996 100644 --- a/build.gradle +++ b/build.gradle @@ -134,7 +134,11 @@ subprojects { dependencySubstitution { substitute module("org.elasticsearch:rest-api-spec:${version}") with project("${projectsPrefix}:rest-api-spec") substitute module("org.elasticsearch:elasticsearch:${version}") with project("${projectsPrefix}:core") - substitute module("org.elasticsearch:test-framework:${version}") with project("${projectsPrefix}:test-framework") + // easy to type bypass so that eclipse doesn't have circular references + // the downside is, if you hack on test-framework, you have to gradle install + if (System.getProperty("eclipse") == null) { + substitute module("org.elasticsearch:test-framework:${version}") with project("${projectsPrefix}:test-framework") + } substitute module("org.elasticsearch.distribution.zip:elasticsearch:${version}") with project("${projectsPrefix}:distribution:zip") } } From 10d4f17aa89ecda6eabc93a1dbc3af40863011c8 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Fri, 30 Oct 2015 14:21:06 -0400 Subject: [PATCH 2/2] make eclipse work without specifying a sysprop --- CONTRIBUTING.md | 2 +- build.gradle | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 517cb153859..969a7ffeeb6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,7 +76,7 @@ Contributing to the Elasticsearch codebase **Repository:** [https://github.com/elastic/elasticsearch](https://github.com/elastic/elasticsearch) -Make sure you have [Gradle](http://gradle.org) installed, as Elasticsearch uses it as its build system. Integration with IntelliJ and Eclipse should work out of the box. Eclipse users can automatically configure their IDE: `File > Import -> Gradle -> Gradle project`. When the `Import Options` dialog is presented, add `-Declipse` to the JVM Options box. Additionally you will want to ensure that Eclipse is using 2048m of heap by modifying `eclipse.ini` accordingly to avoid GC overhead errors. +Make sure you have [Gradle](http://gradle.org) installed, as Elasticsearch uses it as its build system. Integration with IntelliJ and Eclipse should work out of the box. Eclipse users can automatically configure their IDE: `File > Import -> Gradle -> Gradle project`. Additionally you will want to ensure that Eclipse is using 2048m of heap by modifying `eclipse.ini` accordingly to avoid GC overhead errors. Please follow these formatting guidelines: diff --git a/build.gradle b/build.gradle index 3b104702996..171a9e227b8 100644 --- a/build.gradle +++ b/build.gradle @@ -134,9 +134,10 @@ subprojects { dependencySubstitution { substitute module("org.elasticsearch:rest-api-spec:${version}") with project("${projectsPrefix}:rest-api-spec") substitute module("org.elasticsearch:elasticsearch:${version}") with project("${projectsPrefix}:core") - // easy to type bypass so that eclipse doesn't have circular references + // so that eclipse doesn't have circular references // the downside is, if you hack on test-framework, you have to gradle install - if (System.getProperty("eclipse") == null) { + // the first prop detects eclipse itself, the second detects eclipse from commandline + if (System.getProperty("eclipse.launcher") == null && gradle.startParameter.taskNames.contains('eclipse') == false) { substitute module("org.elasticsearch:test-framework:${version}") with project("${projectsPrefix}:test-framework") } substitute module("org.elasticsearch.distribution.zip:elasticsearch:${version}") with project("${projectsPrefix}:distribution:zip")