Ok thanks!
Mario
2016-04-25 19:23 GMT+02:00 John Smiljanic :
> Two separate compilations. One for the traits and transforms (framework
> code). The second for the user scripts that are transformed to dynamically
> implement the trait.
>
> On Apr 22, 2016, at 01:33, Mario Garcia wrote:
>
> Nice
Two separate compilations. One for the traits and transforms (framework code).
The second for the user scripts that are transformed to dynamically
implement the trait.
> On Apr 22, 2016, at 01:33, Mario Garcia wrote:
>
> Nice :)
>
> Just to get this straight, you compiled the traits first an
Nice :)
Just to get this straight, you compiled the traits first and then you
compiled the local transformation and the user-developer code altogether.
It's that correct ?
2016-04-21 23:16 GMT+02:00 John Smiljanic :
> After some digging I found
> org.codehaus.groovy.transform.trait.TraitCompos
After some digging I found
org.codehaus.groovy.transform.trait.TraitComposer and from there I was able
to backtrack to how groovy transforms statically defined traits. This is
performed in canonalization, so it appears that a trait that is added to a
class during semantic analysis may still have i
I'm afraid the latest CompilePhase where you can use that approach is
CONVERSION. That means that in order to achieve what you wanted, you should
be using a global transformation.
Then you can make the ClassNode to implement the given trait .
Hope this helps :)
Mario
2016-04-20 22:08 GMT+02:00 J
Hi All,
Groovy 2.3.7.
I've been experimenting with trying to add a Trait (or Mixin) to a
ClassNode during semantic analysis (compiler phase). I've tried using
ClassNode::addInterface and ClassNode::addMixin passing the appropriate. I
sort of expected ClassNode to have an addTrait or something l