Permalink
Browse files

fixes build errors with Gradle eclipse plugin generated .classpath/.p…

…roject files in STS,

based on pull request: #122
  • Loading branch information...
1 parent 734a1b0 commit b9a9a5926e562f54a3048cc67924cf73c73134d6 @lhotari lhotari committed Dec 10, 2011
Showing with 28 additions and 8 deletions.
  1. +12 −1 grails-plugin-gsp/build.gradle
  2. +6 −7 grails-scripts/build.gradle
  3. +10 −0 grails-web/build.gradle
@@ -29,4 +29,15 @@ jar{
from compileAstGroovy.outputs.files
}
-jar.appendix = 'plugin-gsp'
+jar.appendix = 'plugin-gsp'
+
+eclipse {
+ classpath {
+ file {
+ whenMerged { classpath ->
+ // remove invalid build/resources/ast entry
+ classpath.entries.removeAll { entry -> entry?.kind == 'lib' && entry?.path?.endsWith('build/resources/ast') }
+ }
+ }
+ }
+}
@@ -30,17 +30,16 @@ sourceSets {
jar.appendix = 'scripts'
eclipse {
- /*
- // update ../scripts -> scripts
classpath {
file {
- withXml {
- def node = it.asNode()
- node.children()[1].attributes()['path']='scripts'
+ whenMerged { classpath ->
+ // update ../scripts -> scripts
+ def scriptsSrc = classpath.entries.find { entry -> entry?.kind == 'src' && entry?.path == '../scripts' }
+ if(scriptsSrc) scriptsSrc.path='scripts'
}
}
- }
- */
+ }
+
project {
linkedResource name: 'scripts', type: '2', location: new File('../scripts').canonicalPath
}
View
@@ -49,5 +49,15 @@ jar.appendix = 'web'
eclipse {
classpath {
plusConfigurations += configurations.jsp21
+ file {
+ whenMerged { classpath ->
+ // move jsp-api-2.1 to the last one in entries so that it appears after -2.0
+ def jsp21 = classpath.entries.find { entry -> entry?.path =~ /jsp-api-2.1.jar$/ }
+ if (jsp21) {
+ classpath.entries.remove(jsp21)
+ classpath.entries << jsp21
+ }
+ }
+ }
}
}

2 comments on commit b9a9a59

Contributor

tsuyo replied Dec 13, 2011

Thanks for merging the request. There is one problem remained. We should exclude 'grails-plugin-gsp/build/classes/ast' from the classpath as well because there is no 'build' directory just after cloning git repo.
Sending a new pull request as #133.

Member

lhotari replied Dec 13, 2011

Ok, thanks. I'll merge your pull request in a few days.

Please sign in to comment.