system/src/sc/lang/js/JSRuntimeProcessor.java
public boolean initRuntime(boolean fromScratch) {
      if (!fromScratch || jsBuildInfo != null)
         return false;
      if (system.options.buildAllFiles) {
         jsBuildInfo = new JSBuildInfo();
         return true;
      }
      else {
         String jsBuildInfoFile = FileUtil.concat(system.buildDir, JS_BUILD_INFO_FILE);
         File f = new File(jsBuildInfoFile);
         ObjectInputStream ois = null;
         FileInputStream fis = null;
         if (f.canRead()) {
            try {
               ois = new ObjectInputStream(fis = new FileInputStream(f));
               JSBuildInfo res = (JSBuildInfo) ois.readObject();
               if (res != null) {
                  jsBuildInfo = res;

                  res.init(system);
               }

               // Were able to restore the incremental build info so don't rebuild all
               return false;
            }
            catch (InvalidClassException exc) {
               System.out.println("JS dependency type info - version changed: " + this);
               f.delete();
            }
            catch (IOException exc) {
               System.out.println("*** can't read js build info file: " + exc);
               f.delete();
            }
            catch (ClassNotFoundException exc) {
               System.out.println("*** can't read js build info file: " + exc);
               f.delete();
            }
            finally {
               try {
                  if (ois != null)
                     ois.close();
                  if (fis != null)
                     fis.close();
               }
               catch (IOException exc) {}
            }
         }
         else if (system.options.verbose)
            System.out.println("*** Missing jsBuildInfoFile: " + jsBuildInfoFile + " building all files");
         if (jsBuildInfo == null)
            jsBuildInfo = new JSBuildInfo();
         return true;
      }
   }
/** Returns true if we need to rebuild all.  If fromScratch is true, we reset for a new full build */
Returns true if we need to rebuild all.  If fromScratch is true, we reset for a new full build
Returns true if we need to rebuild all . If fromScratch is true we reset for a new full build
public boolean initRuntime(boolean fromScratch) {
      if (!fromScratch || jsBuildInfo != null)
         return false;
      if (system.options.buildAllFiles) {
         jsBuildInfo = new JSBuildInfo();
         return true;
      }
      else {
         String jsBuildInfoFile = FileUtil.concat(system.buildDir, JS_BUILD_INFO_FILE);
         File f = new File(jsBuildInfoFile);
         ObjectInputStream ois = null;
         FileInputStream fis = null;
         if (f.canRead()) {
            try {
               ois = new ObjectInputStream(fis = new FileInputStream(f));
               JSBuildInfo res = (JSBuildInfo) ois.readObject();
               if (res != null) {
                  jsBuildInfo = res;
                  res.init(system);
               }
               return false;
            }
            catch (InvalidClassException exc) {
               System.out.println("JS dependency type info - version changed: " + this);
               f.delete();
            }
            catch (IOException exc) {
               System.out.println("*** can't read js build info file: " + exc);
               f.delete();
            }
            catch (ClassNotFoundException exc) {
               System.out.println("*** can't read js build info file: " + exc);
               f.delete();
            }
            finally {
               try {
                  if (ois != null)
                     ois.close();
                  if (fis != null)
                     fis.close();
               }
               catch (IOException exc) {}
            }
         }
         else if (system.options.verbose)
            System.out.println("*** Missing jsBuildInfoFile: " + jsBuildInfoFile + " building all files");
         if (jsBuildInfo == null)
            jsBuildInfo = new JSBuildInfo();
         return true;
      }
   }
public boolean initRuntime ( boolean fromScratch ) { if ( ! fromScratch || jsBuildInfo != null ) return false ; if ( system . options . buildAllFiles ) { jsBuildInfo = new JSBuildInfo ( ) ; return true ; } else { String jsBuildInfoFile = FileUtil . concat ( system . buildDir , JS_BUILD_INFO_FILE ) ; File f = new File ( jsBuildInfoFile ) ; ObjectInputStream ois = null ; FileInputStream fis = null ; if ( f . canRead ( ) ) { try { ois = new ObjectInputStream ( fis = new FileInputStream ( f ) ) ; JSBuildInfo res = ( JSBuildInfo ) ois . readObject ( ) ; if ( res != null ) { jsBuildInfo = res ; res . init ( system ) ; } return false ; } catch ( InvalidClassException exc ) { System . out . println ( "JS dependency type info - version changed: " + this ) ; f . delete ( ) ; } catch ( IOException exc ) { System . out . println ( "*** can't read js build info file: " + exc ) ; f . delete ( ) ; } catch ( ClassNotFoundException exc ) { System . out . println ( "*** can't read js build info file: " + exc ) ; f . delete ( ) ; } finally { try { if ( ois != null ) ois . close ( ) ; if ( fis != null ) fis . close ( ) ; } catch ( IOException exc ) { } } } else if ( system . options . verbose ) System . out . println ( "*** Missing jsBuildInfoFile: " + jsBuildInfoFile + " building all files" ) ; if ( jsBuildInfo == null ) jsBuildInfo = new JSBuildInfo ( ) ; return true ; } }
Returns true if we need to rebuild all.
Returns true if we need to rebuild all .
// Were able to restore the incremental build info so don't rebuild all