Hello Groovy users

I am looking for help in setting up my class loaders with the Groovy
compiler. This is my understanding so far

   1. The compiler is an external tool to compile (Groovy is a java based
   compiler) and therefore it must have its own class paths and a class loader
   to load libraries it needs (the COMPILER class loader). This includes the
   transform loaders needed for static compilation etc
   2. The compiled code has its own set of class paths and there must have
   a separate class loader (the CLASSPATH class loader)
   3. The two should be completely separate (I think)

However, the compiler sometimes will add class nodes as part of AST
transformations (Class nodes created with ClassHelper.create) ... In that
case, which class loader should be used for creating these class nodes? Or
does it not matter (I think it matters because I may use a different
version of jar in the compiler vs the compiled code)

If I have to use the CLASSPATH class loader for creating class nodes, are
there standard patterns to help do this (given that ClassHelper.create is a
static method)?

regards
Saravanan

Reply via email to