Examples of CompilerConfiguration


Examples of org.codehaus.groovy.control.CompilerConfiguration

            return;
        }

        displayStackTraceOnError = cli.hasOption('e');

        CompilerConfiguration configuration = generateCompilerConfigurationFromOptions(cli);

        //
        // Load the file name list
        String[] filenames = generateFileNamesFromOptions(cli);
        boolean fileNameErrors = filenames == null;
View Full Code Here

Examples of org.codehaus.groovy.control.CompilerConfiguration

    public static CompilerConfiguration generateCompilerConfigurationFromOptions(CommandLine cli) {
        //
        // Setup the configuration data

        CompilerConfiguration configuration = new CompilerConfiguration();

        if (cli.hasOption("classpath")) {
            configuration.setClasspath(cli.getOptionValue("classpath"));
        }

        if (cli.hasOption('d')) {
            configuration.setTargetDirectory(cli.getOptionValue('d'));
        }

        if (cli.hasOption("encoding")) {
            configuration.setSourceEncoding(cli.getOptionValue("encoding"));
        }

        // joint compilation parameters
        if (cli.hasOption('j')) {
            Map<String, Object> compilerOptions = new HashMap<String, Object>();

            String[] opts = cli.getOptionValues("J");
            compilerOptions.put("namedValues", opts);

            opts = cli.getOptionValues("F");
            compilerOptions.put("flags", opts);

            configuration.setJointCompilationOptions(compilerOptions);
        }
        return configuration;
    }
View Full Code Here

Examples of org.codehaus.groovy.control.CompilerConfiguration

    protected void setUp() throws Exception {
        File dir = new File("target/test-generated-classes");
        dir.mkdirs();

        CompilerConfiguration config = new CompilerConfiguration();
        config.setTargetDirectory(dir);
        config.setDebug(dumpClass);

        compiler = new Compiler(config);
    }
View Full Code Here

Examples of org.codehaus.groovy.control.CompilerConfiguration

        File dir = new File("target/test-generated-classes");
        dir.mkdirs();
        Map options = new HashMap();
        options.put("stubDir", dir);

        CompilerConfiguration configuration = new CompilerConfiguration();
        configuration.setTargetDirectory(dir);
        configuration.setVerbose(dumpClass);
        configuration.setJointCompilationOptions(options);

        compiler = new FileSystemCompiler(configuration);
    }
View Full Code Here

Examples of org.codehaus.groovy.control.CompilerConfiguration

    public GroovyScriptEngineImpl() {
        classMap = Collections.synchronizedMap(new HashMap<String, Class>());
        globalClosures = Collections.synchronizedMap(new HashMap<String, Closure>());
        loader = new GroovyClassLoader(getParentLoader(),
                new CompilerConfiguration());
    }
View Full Code Here

Examples of org.codehaus.groovy.control.CompilerConfiguration

  public SoapUIGroovyScriptEngine( ClassLoader parentClassLoader )
  {
    classLoader = new GroovyClassLoader( parentClassLoader );
    binding = new Binding();
    CompilerConfiguration config = new CompilerConfiguration();
    config.setDebug( true );
    config.setVerbose( true );
    shell = new GroovyShell( classLoader, binding, config );
  }
View Full Code Here

Examples of org.codehaus.groovy.control.CompilerConfiguration

public class ClassicGroovyTestGeneratorHelper implements TestGeneratorHelper {

    /** evaluate the source text against the classic AST with the JSR parser implementation*/
    public Object evaluate(String theSrcText, String testName) throws Exception {
        parse(theSrcText, testName); // fail early with a direct message if possible')
        GroovyShell groovy = new GroovyShell(new CompilerConfiguration());
        return groovy.run(theSrcText, "main", new ArrayList());
    }
View Full Code Here

Examples of org.codehaus.groovy.control.CompilerConfiguration

        File dir = new File("target/test-generated-classes");
        dir.mkdirs();
        Map options = new HashMap();
        options.put("stubDir", dir);

        CompilerConfiguration configuration = new CompilerConfiguration();
        configuration.setTargetDirectory(dir);
        configuration.setVerbose(dumpClass);
        configuration.setJointCompilationOptions(options);

        compiler = new FileSystemCompiler(configuration);
    }
View Full Code Here

Examples of org.codehaus.groovy.control.CompilerConfiguration

    protected void setUp() throws Exception {
        File dir = new File("target/test-generated-classes");
        dir.mkdirs();

        CompilerConfiguration config = new CompilerConfiguration();
        config.setTargetDirectory(dir);
        config.setDebug(dumpClass);

        compiler = new Compiler(config);
    }
View Full Code Here

Examples of org.codehaus.groovy.control.CompilerConfiguration

            parent = GroovyShell.class.getClassLoader();
        final ClassLoader finalParent = parent;
        this.loader =
                (GroovyClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
                    public Object run() {
                        CompilerConfiguration configuration = new CompilerConfiguration();
                        configuration.setClasspath(mgr.getClassPath());
                        return new GroovyClassLoader(finalParent, configuration);
                    }
                });
        execScripts = new HashMap();
        evalScripts = new HashMap();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.