diff -r 7665471a56c1 -r f62b42f0b751 rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AheadOfTime.java --- a/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AheadOfTime.java Tue May 27 12:25:41 2014 +0200 +++ b/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AheadOfTime.java Mon Jun 09 12:40:40 2014 +0200 @@ -104,7 +104,12 @@ File aot = new File(prj.getBuild().getDirectory(), classPathPrefix); aot.mkdirs(); File js = new File(aot, n.substring(0, n.length() - 4) + ".js"); + if (js.exists()) { + getLog().info("Skipping " + js + " as it already exists."); + continue; + } try { + getLog().info("Generating " + js); aotLibrary(a, js , loader); } catch (IOException ex) { throw new MojoFailureException("Can't compile" + a.getFile(), ex); @@ -112,18 +117,23 @@ } try { - Bck2Brwsr c = Bck2BrwsrJars.configureFrom(null, mainJar); - if (exports != null) { - for (String e : exports) { - c = c.addExported(e.replace('.', '/')); + if (mainJavaScript.exists()) { + getLog().info("Skipping " + mainJavaScript + " as it already exists."); + } else { + getLog().info("Generating " + mainJavaScript); + Bck2Brwsr c = Bck2BrwsrJars.configureFrom(null, mainJar); + if (exports != null) { + for (String e : exports) { + c = c.addExported(e.replace('.', '/')); + } } + FileWriter w = new FileWriter(mainJavaScript); + c. + obfuscation(obfuscation). + resources(loader). + generate(w); + w.close(); } - FileWriter w = new FileWriter(mainJavaScript); - c. - obfuscation(obfuscation). - resources(loader). - generate(w); - w.close(); } catch (IOException ex) { throw new MojoFailureException("Cannot generate script for " + mainJar, ex); }