Hi,

I've run across an interesting problem in the classloader isolation stuff for groovy compilation.

The symptom is, when I change the constructor of a java class which a groovy class extends, then compilation fails, complaining that the java class does not have the old constructor. For example, when I removed the dag parameter from DefaultTask and updated the groovy tasks, I got lots of compilation failures complaining that constructor DefaultTask(project, name, dag) did not exist, even though everything had been updated to use the constructor.

Digging a little, I found that if I excluded gradle*.jar from the classpath used to build the isolated classloader in GradleUtil.executeIsolatedAntScript() then everything compiled fine. It appears that groovyc is picking up the old classes from its classloader, rather than from the source it is given. However, when I removed gradle from the classloader, I also had to remove the ant logging adapter from the isolated ant build.

I haven't checked any of these changes in - these were just experiments on my machine.

So, I'm not sure what to do with this now. I don't really understand the purpose of executeIsolatedAntScript() so I can't really suggest (or implement) any solutions yet. I guess that strictly speaking, the classpath of the isolated ant script should be as minimal as possible. This means probably just ant and groovy and nothing else.


Adam

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to