Package org.codehaus.groovy.control

Examples of org.codehaus.groovy.control.CompilationUnit$SourceUnitOperation


class GradleModellingLanguageCompilingTestClassLoader extends GroovyClassLoader {

    protected CompilationUnit createCompilationUnit(CompilerConfiguration compilerConfiguration,
                                                    CodeSource codeSource) {
        CompilationUnit compilationUnit = new CompilationUnit(compilerConfiguration, codeSource, this);

        compilationUnit.addPhaseOperation(new GradleModellingLanguageTransformer(), Phases.CANONICALIZATION);
        return compilationUnit;
    }
View Full Code Here


    }

    // Get the description using a partial compilation because it is much faster than compiling the class
    // the class will be compiled lazyly
    String resolveDescription = null;
    CompilationUnit cu = new CompilationUnit(objectGroovyClassFactory.config);
    cu.addSource(name, script);
    try {
      cu.compile(Phases.CONVERSION);
    }
    catch (CompilationFailedException e) {
      throw new CommandException(ErrorKind.INTERNAL, "Could not compile command", e);
    }
    CompileUnit ast = cu.getAST();
    if (ast.getClasses().size() > 0) {
      ClassNode classNode= (ClassNode)ast.getClasses().get(0);
      if (classNode != null) {
        for (AnnotationNode annotation : classNode.getAnnotations()) {
          if (annotation.getClassNode().getName().equals(Usage.class.getSimpleName())) {
View Full Code Here

TOP

Related Classes of org.codehaus.groovy.control.CompilationUnit$SourceUnitOperation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.