/** * Same as main(args) except that exceptions are thrown out instead of causing * the VM to exit. */ public static void commandLineCompile(String[] args) throws Exception { commandLineCompile(args, true); }
public void testCommandLine() throws Exception { try { FileSystemCompiler.commandLineCompile(new String[] {"--bogus-option"}); fail("Compiler fails to reject bogus command line"); } catch (Exception re) { // this is why shouldFail {} exists in Groovy tests } File dir = new File("target/test-generated-classes/cl"); dir.mkdirs(); FileSystemCompiler.commandLineCompile(new String[] {"src/test/groovy/LittleClosureTest.groovy", "-d", dir.getPath()}); }
/** * Primary entry point for compiling from the command line * (using the groovyc script). * <p> * If calling inside a process and you don't want the JVM to exit on an * error call commandLineCompile(String[]), which this method simply wraps * * @param args command line arguments * @param lookupUnnamedFiles do a lookup for .groovy files not part of * the given list of files to compile */ public static void commandLineCompileWithErrorHandling(String[] args, boolean lookupUnnamedFiles) { try { commandLineCompile(args, lookupUnnamedFiles); } catch (Throwable e) { new ErrorReporter(e, displayStackTraceOnError).write(System.err); System.exit(1); } }
/** * Same as main(args) except that exceptions are thrown out instead of causing * the VM to exit. */ public static void commandLineCompile(String[] args) throws Exception { commandLineCompile(args, true); }
/** * Primary entry point for compiling from the command line * (using the groovyc script). * * If calling inside a process and you don't want the JVM to exit on an * error call commandLineCompile(String[]), which this method simply wraps */ public static void main(String[] args) { try { commandLineCompile(args); } catch( Throwable e ) { new ErrorReporter( e, displayStackTraceOnError).write( System.err ); System.exit(1); } }
/** * Primary entry point for compiling from the command line * (using the groovyc script). * * If calling inside a process and you don't want the JVM to exit on an * error call commandLineCompile(String[]), which this method simply wraps */ public static void main(String[] args) { try { commandLineCompile(args); } catch( Throwable e ) { new ErrorReporter( e, displayStackTraceOnError).write( System.err ); System.exit(1); } }
/** * Primary entry point for compiling from the command line * (using the groovyc script). * * If calling inside a process and you don't want the JVM to exit on an * error call commandLineCompile(String[]), which this method simply wraps * * @param args command line arguments * @param lookupUnnamedFiles do a lookup for .groovy files not part of * the given list of files to compile */ public static void commandLineCompileWithErrorHandling(String[] args, boolean lookupUnnamedFiles) { try { commandLineCompile(args, lookupUnnamedFiles); } catch( Throwable e ) { new ErrorReporter( e, displayStackTraceOnError).write( System.err ); System.exit(1); } }