Regenerate the JS file when it exists, but the original JAR is newer
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Mon, 20 Apr 2015 10:03:12 +0300
changeset 1826511463a1733d
parent 1825 e678bb6beb1f
child 1827 f07753959dcf
Regenerate the JS file when it exists, but the original JAR is newer
rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AheadOfTime.java
     1.1 --- a/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AheadOfTime.java	Wed Apr 15 17:21:28 2015 +0200
     1.2 +++ b/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AheadOfTime.java	Mon Apr 20 10:03:12 2015 +0300
     1.3 @@ -117,7 +117,7 @@
     1.4              File aot = new File(mainJavaScript.getParent(), classPathPrefix);
     1.5              aot.mkdirs();
     1.6              File js = new File(aot, n.substring(0, n.length() - 4) + ".js");
     1.7 -            if (js.exists()) {
     1.8 +            if (js.lastModified() > a.getFile().lastModified()) {
     1.9                  getLog().info("Skipping " + js + " as it already exists.");
    1.10                  continue;
    1.11              }
    1.12 @@ -129,7 +129,7 @@
    1.13          }
    1.14          
    1.15          try {
    1.16 -            if (mainJavaScript.exists()) {
    1.17 +            if (mainJavaScript.lastModified() > mainJar.lastModified()) {
    1.18                  getLog().info("Skipping " + mainJavaScript + " as it already exists.");
    1.19              } else {
    1.20                  getLog().info("Generating " + mainJavaScript);