From 71e29a7671f541a356a76422efb82f6975df03fb Mon Sep 17 00:00:00 2001 From: Arunachalam Thirupathi Date: Wed, 18 Jun 2014 08:18:30 -0700 Subject: [PATCH] eclipse import is broken 1) src/java is defined multiple times which causes the problem 2) outputDir is set to bin, which erases all the shell scripts --- build.gradle | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/build.gradle b/build.gradle index 1e69365cf..54c835f0b 100644 --- a/build.gradle +++ b/build.gradle @@ -502,3 +502,50 @@ dependencies { compile 'com.google.code.typica:typica:1.7.2' compile 'com.sna-projects.krati:krati:0.4.9' } + +eclipse { + jdt { + // Currently the javac Version of jar is set to 1.5 + // But @Override works differently between both, so overriding here + sourceCompatibility = targetCompatibility = 1.6 + } + classpath { + defaultOutputDir = project.file('classes') + file { + // SourceSets creates multiple src/java in .classpath with varying includes + // But eclipse 4.3 is complaining about duplicate classpaths + // If contrib root is included instead of the seperate projects, eclipse + // expects the package to be different. ( contrib.restclient.test.voldemort.client + // versus voldemort.client ). So removing all the src entries and adding the previous + // src entries which used to work. + whenMerged { classpath -> + classpath.entries.removeAll { entry -> + (entry.kind == 'src' ) + } + } + withXml { + def node = it.asNode() + [ "src/java", + "contrib/ec2-testing/resources", + "contrib/ec2-testing/src/java", + "contrib/ec2-testing/test", + "contrib/hadoop-store-builder/test", + "contrib/hadoop-store-builder/src/java", + "test/unit", + "test/integration", + "test/common", + "test/long", + "example/java", + "contrib/krati/src/java", + "contrib/krati/test", + "contrib/collections/src/java", + "contrib/collections/test", + "contrib/restclient/src/java", + "contrib/restclient/test"] + .each{ + node.appendNode('classpathentry', [kind: 'src', path: "$it"]) + } + } + } + } +} \ No newline at end of file -- 2.11.4.GIT