Search in sources :

Example 11 with GeneratorContext

use of org.codehaus.groovy.classgen.GeneratorContext in project groovy by apache.

the class DependencyTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    cache = new StringSetMap();
    cu = new CompilationUnit();
    cu.addPhaseOperation((final SourceUnit source, final GeneratorContext context, final ClassNode classNode) -> {
        DependencyTracker dt = new DependencyTracker(source, cache);
        dt.visitClass(classNode);
    }, Phases.CLASS_GENERATION);
}
Also used : CompilationUnit(org.codehaus.groovy.control.CompilationUnit) ClassNode(org.codehaus.groovy.ast.ClassNode) SourceUnit(org.codehaus.groovy.control.SourceUnit) GeneratorContext(org.codehaus.groovy.classgen.GeneratorContext)

Aggregations

GeneratorContext (org.codehaus.groovy.classgen.GeneratorContext)11 ClassNode (org.codehaus.groovy.ast.ClassNode)10 SourceUnit (org.codehaus.groovy.control.SourceUnit)6 InnerClassNode (org.codehaus.groovy.ast.InnerClassNode)4 CompilationUnit (org.codehaus.groovy.control.CompilationUnit)4 GroovyClassVisitor (org.codehaus.groovy.ast.GroovyClassVisitor)3 CompilationFailedException (org.codehaus.groovy.control.CompilationFailedException)3 Script (groovy.lang.Script)2 CompileStatic (groovy.transform.CompileStatic)2 File (java.io.File)2 AnnotationNode (org.codehaus.groovy.ast.AnnotationNode)2 ConstantExpression (org.codehaus.groovy.ast.expr.ConstantExpression)2 Expression (org.codehaus.groovy.ast.expr.Expression)2 CompilationCustomizer (org.codehaus.groovy.control.customizers.CompilationCustomizer)2 ASTTransformationCollectorCodeVisitor (org.codehaus.groovy.transform.ASTTransformationCollectorCodeVisitor)2 Binding (groovy.lang.Binding)1 GroovyClassLoader (groovy.lang.GroovyClassLoader)1 GroovyShell (groovy.lang.GroovyShell)1 InheritConstructors (groovy.transform.InheritConstructors)1 FileOutputStream (java.io.FileOutputStream)1