Skip to content

Commit

Permalink
GROOVY-6226: Configure Gradle Eclipse plugin for groovy-core
Browse files Browse the repository at this point in the history
Part 1: Most subproject now seem to work in Eclipse, but the main project still does not
  • Loading branch information
PascalSchumacher committed Jul 7, 2013
1 parent 81aefec commit 0c15d11
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 2 deletions.
68 changes: 68 additions & 0 deletions .gitignore
Expand Up @@ -12,3 +12,71 @@ out
/bin
user.gradle

/subprojects/groovy-all-tests/bin
/subprojects/groovy-all-tests/.project
/subprojects/groovy-all-tests/.settings
/subprojects/groovy-all-tests/.classpath
/subprojects/groovy-ant/bin
/subprojects/groovy-ant/.project
/subprojects/groovy-ant/.settings
/subprojects/groovy-ant/.classpath
/subprojects/groovy-bsf/bin
/subprojects/groovy-bsf/.project
/subprojects/groovy-bsf/.settings
/subprojects/groovy-bsf/.classpath
/subprojects/groovy-console/bin
/subprojects/groovy-console/.project
/subprojects/groovy-console/.settings
/subprojects/groovy-console/.classpath
/subprojects/groovy-docgenerator/bin
/subprojects/groovy-docgenerator/.project
/subprojects/groovy-docgenerator/.settings
/subprojects/groovy-docgenerator/.classpath
/subprojects/groovy-groovydoc/bin
/subprojects/groovy-groovydoc/.project
/subprojects/groovy-groovydoc/.settings
/subprojects/groovy-groovydoc/.classpath
/subprojects/groovy-groovysh/bin
/subprojects/groovy-groovysh/.project
/subprojects/groovy-groovysh/.settings
/subprojects/groovy-groovysh/.classpath
/subprojects/groovy-jmx/bin
/subprojects/groovy-jmx/.project
/subprojects/groovy-jmx/.settings
/subprojects/groovy-jmx/.classpath
/subprojects/groovy-json/bin
/subprojects/groovy-json/.project
/subprojects/groovy-json/.settings
/subprojects/groovy-json/.classpath
/subprojects/groovy-jsr223/bin
/subprojects/groovy-jsr223/.project
/subprojects/groovy-jsr223/.settings
/subprojects/groovy-jsr223/.classpath
/subprojects/groovy-servlet/bin
/subprojects/groovy-servlet/.project
/subprojects/groovy-servlet/.settings
/subprojects/groovy-servlet/.classpath
/subprojects/groovy-sql/bin
/subprojects/groovy-sql/.project
/subprojects/groovy-sql/.settings
/subprojects/groovy-sql/.classpath
/subprojects/groovy-swing/bin
/subprojects/groovy-swing/.project
/subprojects/groovy-swing/.settings
/subprojects/groovy-swing/.classpath
/subprojects/groovy-templates/bin
/subprojects/groovy-templates/.project
/subprojects/groovy-templates/.settings
/subprojects/groovy-templates/.classpath
/subprojects/groovy-test/bin
/subprojects/groovy-test/.project
/subprojects/groovy-test/.settings
/subprojects/groovy-test/.classpath
/subprojects/groovy-testng/bin
/subprojects/groovy-testng/.project
/subprojects/groovy-testng/.settings
/subprojects/groovy-testng/.classpath
/subprojects/groovy-xml/bin
/subprojects/groovy-xml/.project
/subprojects/groovy-xml/.settings
/subprojects/groovy-xml/.classpath
6 changes: 4 additions & 2 deletions README.md
Expand Up @@ -28,10 +28,12 @@ To build from IntelliJ IDEA

Then open the generated project in IDEA.

To build from Eclipse:
To build from Eclipse (work in progress see [GROOVY-6226](https://jira.codehaus.org/browse/GROOVY-6226) for details)

Sadly this is not possible at the moment (10/23/2013).
./gradlew cleanEclipse eclipse
./gradlew jarAll

Then open the generated project and the generated subprojects in Eclipse.

InvokeDynamic support
---
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Expand Up @@ -503,6 +503,7 @@ apply from: "gradle/docs.gradle"
apply from: "gradle/assemble.gradle"
apply from: "gradle/upload.gradle"
apply from: "gradle/idea.gradle"
apply from: "gradle/eclipse.gradle"
// Define a GroovyDoc task which depends on the generated groovydoc tool
apply from: "gradle/groovydoc.gradle"

Expand Down
34 changes: 34 additions & 0 deletions gradle/eclipse.gradle
@@ -0,0 +1,34 @@
allprojects {
apply plugin: 'eclipse'

eclipse.classpath.file {
whenMerged { classpath ->
classpath.entries.removeAll{ entry -> entry.path == '/groovy-groovydoc' }
classpath.entries.removeAll{ entry -> entry.path =~ /groovy-ant/ }
classpath.entries.removeAll{ entry -> entry.path =~ /target/ }
classpath.entries.unique(true){ entry -> entry.path}
}
withXml {
def node = it.asNode()
node.appendNode('classpathentry', [kind: 'lib', path: "${rootProject.jar.archivePath}"])
}
}
}

eclipse.classpath.file {
whenMerged { classpath ->
classpath.entries.removeAll{ entry -> entry.path == '/groovy-test' }
classpath.entries.removeAll{ entry -> entry.path =~ /subprojects/ }
classpath.entries.removeAll{ entry -> entry.path =~ /examples/ }
classpath.entries.removeAll{ entry -> entry.path =~ /src\/main/ }
}
withXml {
def node = it.asNode()
node.appendNode('classpathentry', [kind: 'src', path: "/groovy/src/main"])
['groovy-test', 'groovy-groovydoc', 'groovy-jmx', 'groovy-xml'].each{
node.appendNode('classpathentry', [kind: 'src', path: "/groovy/subprojects/$it/src/main/groovy"])
node.appendNode('classpathentry', [kind: 'src', path: "/groovy/subprojects/$it/src/main/java"])
}
node.appendNode('classpathentry', [kind: 'src', path: "/groovy/subprojects/groovy-templates/src/main/java"])
}
}

0 comments on commit 0c15d11

Please sign in to comment.