Some AST transformation examples

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Some AST transformation examples

robelsner
These are geared toward Grails, but make use of Groovy's AST
Transformations so I thought the wider Groovy community might be
interested:

The first is a simple Groovy global AST which adds the @Multitenant to
any class in the com.eschewobufscation package.  I do not have this
configurable yet, that is a todo so if anyone wants to help I would
appreciate it.  Otherwise, this is just a simple gradle build for a
jar that you plop in to your grails lib/ directory.

https://github.com/thatsnotright/multitenant-ast

The second is a plugin for grails which adds the @ActiveFilterable,
and this does an AST transform to add a "boolean active" field, as
well as using the Hibernate Filters plugin to create a default filter
of "active=true" which should be applied to any DomainObject.list()
and whatnot, with the same rules as the Hibernate Filters plugin ...
I'm still looking in to how I set up this project to be part of the
Grails ecosystem when its hosted in GitHub, but you can build it
yourself after you clone by doing "grails package-plugin"

https://github.com/thatsnotright/grails-active-filterable

Comments are welcome, my Git and GitHub-fu are weak.

Rob Elsner

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

    http://xircles.codehaus.org/manage_email