groovy
  1. groovy
  2. GROOVY-5025

Add control on how Global Transforms are loaded/applied

    Details

    • Number of attachments :
      0

      Description

      It would be nice to have more control on how the global transforms are loaded and applied. For example, there is no way to avoid the GrabAnnotationTransformation to be applied even if you forbid it through the use of a (Security) CompilerCustomizer.

      According to CÚdric Champeau it is not that trivial because the Global Transforms process is tightly hardwired with the compilation process. The only (ugly) workaround is to override the Groovy classloader.

      It should be nice if you could specify a sort of "blacklist" of GlobalTransforms that has to be ignored during the compilation phase.

      Ideally, it should be possible to do this with a Compiler Customization.

        Issue Links

          Activity

          Hide
          CÚdric Champeau added a comment -

          Due to breaking changes, the fix is only available in 1.9.x. CompilerConfiguration now has setDisabledGlobalASTTransformations method which allows you to specify a list of fully qualified class names of global AST transformations that should be ignored. Especially, this allows you to disable groovy.grape.GrabAnnotationTransformation and org.codehaus.groovy.ast.builder.AstBuilderTransformation.

          Show
          CÚdric Champeau added a comment - Due to breaking changes, the fix is only available in 1.9.x. CompilerConfiguration now has setDisabledGlobalASTTransformations method which allows you to specify a list of fully qualified class names of global AST transformations that should be ignored. Especially, this allows you to disable groovy.grape.GrabAnnotationTransformation and org.codehaus.groovy.ast.builder.AstBuilderTransformation .

            People

            • Assignee:
              CÚdric Champeau
              Reporter:
              Fabien Hulliez
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: