Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5553

Provide a builder for compilation customizers

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.1.0-beta-1
    • None
    • None

    Description

      Customizing the compilation process is possible using compilation customizers, however there is no lightweight syntax to define such customizers.

      The objective of this task is to define a builder to generate such a configuration. For example:

      def config = new CompilerConfiguration()
      config.customizers {
          ast(CompileStatic)
          source(extension: 'sgroovy') {
              ast(CompileStatic)        
          }
          imports {
              normal 'java.io.Foo'
              normal List
              star 'groovy.transform'
          }
          secureAst {
              closuresAllowed = false
              methodDefinitionAllowed = false
          }
          inline(phase: 'CONVERSION') { source, context, classNode ->
              println "hello $classNode"
          }
      }
      

      Attachments

        Issue Links

          Activity

            People

              melix Cédric Champeau
              melix Cédric Champeau
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: