protected void runTest(String[] names) throws Exception { List files = new ArrayList(); for (int i = 0; i < names.length; i++) { String name = names[i]; File file = new File("src/test/groovy/" + name); files.add(file); assertTrue("Could not find source file: " + file, file.exists()); } compiler.compile((File[]) files.toArray(new File[names.length])); }
compiler.compile(filenames); } finally { try {
private void compile(File dir, File[] files) throws Exception { final CompilationUnit unit = new JavaAwareCompilationUnit(compilerConfiguration, compilerClassLoader, null); new FileSystemCompiler(compilerConfiguration, unit).compile(files); }
public static void doCompilation(CompilerConfiguration configuration, CompilationUnit unit, String[] filenames) throws Exception { File tmpDir = null; // if there are any joint compilation options set stubDir if not set try { if ((configuration.getJointCompilationOptions() != null) && !configuration.getJointCompilationOptions().containsKey("stubDir")) { tmpDir = createTempDir(); configuration.getJointCompilationOptions().put("stubDir", tmpDir); } FileSystemCompiler compiler = new FileSystemCompiler(configuration, unit); compiler.compile(filenames); } finally { try { if (tmpDir != null) deleteRecursive(tmpDir); } catch (Throwable t) { System.err.println("error: could not delete temp files - " + tmpDir.getPath()); } } }
public static void doCompilation(CompilerConfiguration configuration, CompilationUnit unit, String[] filenames) throws Exception { File tmpDir = null; // if there are any joint compilation options set stub dir if not set try { if ((configuration.getJointCompilationOptions() != null) && !configuration.getJointCompilationOptions().containsKey("stubDir")) { tmpDir = createTempDir(); configuration.getJointCompilationOptions().put("stubDir", tmpDir); } FileSystemCompiler compiler = new FileSystemCompiler(configuration, unit); compiler.compile(filenames); } finally { try { if (tmpDir != null) deleteRecursive(tmpDir); } catch (Throwable t) { System.err.println("error: could not delete temp files - " + tmpDir.getPath()); } } }
compiler.compile( filenames );
compiler.compile(filenames); } finally { try {