Package groovy.lang

Examples of groovy.lang.GroovyShell.run()


     */
    private void processOnce() throws CompilationFailedException, IOException {
        GroovyShell groovy = new GroovyShell(conf);

        if (isScriptFile) {
            groovy.run(huntForTheScriptFile(script), args);
        }
        else {
            groovy.run(script, "script_from_command_line", args);
        }
    }
View Full Code Here


        if (isScriptFile) {
            groovy.run(huntForTheScriptFile(script), args);
        }
        else {
            groovy.run(script, "script_from_command_line", args);
        }
    }
}
View Full Code Here

     */
    private void processOnce() throws CompilationFailedException, IOException {
        GroovyShell groovy = new GroovyShell(conf);

        if (isScriptFile) {
            groovy.run(huntForTheScriptFile(script), args);
        }
        else {
            groovy.run(script, "script_from_command_line", args);
        }
    }
View Full Code Here

        if (isScriptFile) {
            groovy.run(huntForTheScriptFile(script), args);
        }
        else {
            groovy.run(script, "script_from_command_line", args);
        }
    }
}
View Full Code Here

            }
            script.run();
        }
        catch (final MissingMethodException e) {
            // not a script, try running through run method but properties will not be available
            groovy.run(txt, scriptName, cmdline.getCommandline());
        }
        catch (final CompilationFailedException e) {
            StringWriter writer = new StringWriter();
            new ErrorReporter( e, false ).write( new PrintWriter(writer) );
            String message = writer.toString();
View Full Code Here

              final String scriptName = commandLine.getOptionValue("script");
              final File scriptFile = getAbsoluteFile(scriptName);
             
              final CompilerConfiguration conf = new CompilerConfiguration(System.getProperties());
              final GroovyShell shell = new GroovyShell(binding, conf);
              shell.run(scriptFile, args);
          }
          else {
              final Groovysh shell = new Groovysh(binding, new IO());
              shell.run();
          }
View Full Code Here

              final GroovyShell shell = new GroovyShell(binding, conf);
              shell.run(scriptFile, args);
          }
          else {
              final Groovysh shell = new Groovysh(binding, new IO());
              shell.run();
          }
        }
        finally {
          if (applicationContext instanceof DisposableBean) {
            ((DisposableBean) applicationContext).destroy();
View Full Code Here

*/
public class MainTest extends TestSupport {

    public void testMainMethod() throws Exception {
        GroovyShell shell = new GroovyShell();
        shell.run(new File("src/test/groovy/SampleMain.groovy"), new String[]{"A", "B", "C"});
    }
}
View Full Code Here

    /** 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());
    }

    /** run the JSR parser implementation over the supplied source text*/
    public void parse(String theSrcText, String testName) throws Exception {
        System.out.println("-------------------------------");
View Full Code Here

     * Process the standard, single script with args.
     */
    private void processOnce() throws CompilationFailedException, IOException, URISyntaxException {
        GroovyShell groovy = new GroovyShell(conf);
        setupContextClassLoader(groovy);
        groovy.run(getScriptSource(isScriptFile, script), args);
    }
}
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.