You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/05/18 17:04:42 UTC

[02/19] incubator-geode git commit: Fixing compile errors in eclipse

Fixing compile errors in eclipse

We were seeing compile errors in eclipse due to:
1) Missing gradle output dirs in the extensions module. I removed those
dirs from the eclipse classpath

2) Access restrictions on things like Unsafe. This was caused by a
change in gradle 2.12 to add the java 1.8 execution environment, rather
than the direct JDK dependency, to the project. That turned on access
restrictions in eclipse for  the execution environment.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/c35f76f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/c35f76f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/c35f76f9

Branch: refs/heads/feature/GEODE-1392
Commit: c35f76f96aeb5cf1c674be440953bb10521de8bd
Parents: 3490f37
Author: Dan Smith <up...@apache.org>
Authored: Thu May 12 17:10:29 2016 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Wed May 18 10:04:22 2016 -0700

----------------------------------------------------------------------
 extensions/geode-modules-tomcat7/build.gradle |  6 ++++++
 gradle/ide.gradle                             | 15 ++++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c35f76f9/extensions/geode-modules-tomcat7/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/geode-modules-tomcat7/build.gradle b/extensions/geode-modules-tomcat7/build.gradle
index 975c976..3c75e56 100644
--- a/extensions/geode-modules-tomcat7/build.gradle
+++ b/extensions/geode-modules-tomcat7/build.gradle
@@ -49,4 +49,10 @@ dependencies {
   testCompile project(path: ':geode-junit')
   testCompile files(project(':geode-core').sourceSets.test.output)
   testCompile files(project(':extensions/geode-modules').sourceSets.test.output)
+
+  eclipse.classpath.file {
+    whenMerged { classpath ->
+      classpath.entries.removeAll { entry -> entry.path.contains('geode-modules/build')}
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c35f76f9/gradle/ide.gradle
----------------------------------------------------------------------
diff --git a/gradle/ide.gradle b/gradle/ide.gradle
index adaf8d9..03f6565 100644
--- a/gradle/ide.gradle
+++ b/gradle/ide.gradle
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+import org.gradle.plugins.ide.eclipse.model.Container
 allprojects {
   apply plugin: 'idea'
   apply plugin: 'eclipse'
@@ -26,11 +27,19 @@ subprojects {
       downloadSources = true
       plusConfigurations += [ configurations.provided ]
       file {
-        // Remove the gradle output directories from the eclipse classpath.
-        // Unfortunately, using minusConfigurations does not work here, because
-        // it removes the entire geode-core project.
         whenMerged { classpath ->
+            // Remove the gradle output directories from the eclipse classpath.
+            // Unfortunately, using minusConfigurations does not work here, because
+            // it removes the entire geode-core project.
             classpath.entries.removeAll { entry -> entry.path.contains('geode-core/build')}
+
+            //By default, gradle adds the java 1.8 *execution environment*, which has access restrictions on
+            //things like Unsafe. Change it to a direct dependency on the workspace JDK
+            classpath.entries = classpath.entries.collect { entry -> 
+              entry.path.contains('org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE')
+                ? new Container('org.eclipse.jdt.launching.JRE_CONTAINER')
+                : entry
+            }
         }
       }
     }