MCPcopy Index your code
hub / github.com/apache/groovy / main

Method main

src/main/java/groovy/util/GroovyScriptEngine.java:350–365  ·  view source on GitHub ↗

Simple testing harness for the GSE. Enter script roots as arguments and then input script names to run them. @param urls an array of URLs @throws Exception if something goes wrong

(String[] urls)

Source from the content-addressed store, hash-verified

348 * @throws Exception if something goes wrong
349 */
350 public static void main(String[] urls) throws Exception {
351 GroovyScriptEngine gse = new GroovyScriptEngine(urls);
352 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
353 String line;
354 while (true) {
355 System.out.print("groovy> ");
356 if ((line = br.readLine()) == null || "quit".equals(line)) {
357 break;
358 }
359 try {
360 System.out.println(gse.run(line, new Binding()));
361 } catch (Exception e) {
362 e.printStackTrace();
363 }
364 }
365 }
366
367 /**
368 * Initialize a new GroovyClassLoader with a default or

Callers

nothing calls this directly

Calls 6

runMethod · 0.95
printStackTraceMethod · 0.80
equalsMethod · 0.65
printMethod · 0.45
readLineMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected