Steve Appling wrote:
Russel Winder wrote:
On Sat, 2009-07-11 at 08:03 -0400, Steve Appling wrote:
I think I may have gotten that with mismatched curly braces before.
Why don't you post your build.gradle (or at least the part that you
changed to cause the failure).
I don't think that is it in this case. The two bits of the Gradle file
that are the bits that depend on the variation are:
groovyHome = System.getenv ( ).'GROOVY_HOME'
if ( groovyHome ) {
groovyLib = new File ( groovyHome , 'lib' )
def groovyVersionPatternString =
/^groovy-(all-)?([0-9].*)\.jar/
def items = groovyLib.listFiles ( [ accept : { File dir ,
String name -> return ( name =~ groovyVersionPatternString ).find ( )
} ] as FilenameFilter )
assert items groovyVersion = ( items[0].name =~
groovyVersionPatternString )[0][2]
assert groovyVersion
}
else {
groovyVersion =
ant.antProject.properties.groovyStandaloneVersion
}
. . .
repositories {
if ( groovyHome ) { flatDir ( name : 'groovyInstallation' ,
dirs : [ new File ( groovyHome , 'embeddable' ) , groovyLib ] ) }
mavenCentral ( )
}
If I unset GROOVY_HOME then it all compiles fine (it's the Gant
build).
If I have GROOVY_HOME set then I get the error. So on the one hand the
problem cannot be in the code other than the above, and on the other
hand it shouldn't be in the code above either :-)
I think that perhaps when you have GROOVY_HOME set, it is not getting
the groovy jar correctly. I certainly don't have an answer for you,
but I may have some insights:
The GroovyCompile task uses AntGroovyC to do the compile with a
different classloadder. It does this by writing a small anonymous
groovy script and running it with another classloader. This is the
"Script1.groovy" you are seeing. I'm not sure exactly why you are
getting this problem, but you can get strange errors here if it can't
find the ant or groovy jars in the groovy classpath.
Are you running with the version of gradle from the trunk? If so,
there may be some issue with some changes I made to track whether any
files compiled or not. It did introduce a parameter called "task" to
the script used to do the compile.
If you run it with -d you should see a log message like: "Using
groovyc as:" - this will contain the content of the script that is
executed. It would be helpful to see that.
Also, which version of groovy are you pointing to in GROOVY_HOME? The
anonymous script is compiled and run using the version of groovy in your
'groovy' configuration, rather than the 1.6.3 shipped with Gradle, so
perhaps some incompatibility has been introduced there.
Adam
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email