Process the input files.
()
| 596 | * Process the input files. |
| 597 | */ |
| 598 | private void processFiles() throws CompilationFailedException, IOException, URISyntaxException { |
| 599 | GroovyShell groovy = new GroovyShell(Thread.currentThread().getContextClassLoader(), conf); |
| 600 | setupContextClassLoader(groovy); |
| 601 | |
| 602 | Script s = groovy.parse(getScriptSource(isScriptFile, script)); |
| 603 | |
| 604 | if (args.isEmpty()) { |
| 605 | try(BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { |
| 606 | PrintWriter writer = new PrintWriter(System.out); |
| 607 | processReader(s, reader, writer); |
| 608 | writer.flush(); |
| 609 | } |
| 610 | } else { |
| 611 | for (String filename : args) { |
| 612 | //TODO: These are the arguments for -p and -i. Why are we searching using Groovy script extensions? |
| 613 | // Where is this documented? |
| 614 | File file = huntForTheScriptFile(filename); |
| 615 | processFile(s, file); |
| 616 | } |
| 617 | } |
| 618 | } |
| 619 | |
| 620 | /** |
| 621 | * Process a single input file. |
no test coverage detected