JSDOC/Packer.js
[gnome.introspection-doc-generator] / JSDOC / Packer.js
index c210e10..edc4eb0 100644 (file)
@@ -86,15 +86,30 @@ Packer = function(cfg)
     
     var link = false;
     if (cfg.autoBuild) {
+        
+        function dateString(d){
+            function pad(n){return n<10 ? '0'+n : n}
+            return d.getUTCFullYear() +
+                  pad(d.getUTCMonth()+1)+
+                 pad(d.getUTCDate())+'_'+
+                 pad(d.getUTCHours())+
+                 pad(d.getUTCMinutes())+'
+                 pad(d.getUTCSeconds());
+        }
+
+        
+        
         var version = 0;
         this.files.forEach(function(f) {
             version = Math.max(File.mtime(f), version);
         });
+        var version  = dateString(new Date(version));
+        
         var dirname = GLib.path_get_dirname(this.files[0]);
         var outname = this.module ? this.module : GLib.path_get_basename(dirname);
         this.target = dirname + '/compiled/' + outname + '-' + version + '.js';
          if (File.exists(this.target)) {
-            print("Target file already exists");
+            print("Target file already exists: " + this.target);
             Seed.quit();
         }
         this.prefix = dirname +'/';
@@ -102,7 +117,7 @@ Packer = function(cfg)
         
     }
      
-    
+    print(this.translateJSON);
     this.timer =  new Date() * 1;
     this.packAll();
     
@@ -151,8 +166,8 @@ Packer.prototype = {
      */
     cleanup : true,  
     /**
-     * @cfg {Boolean} cleanup  (optional) clean up temp files after done - 
-     *    Defaults to false if you set tmpDir, otherwise true.
+     * @cfg {Boolean} keepWhite (optional) do not remove white space in output.
+     *    usefull for debugging compressed files.
      */
     
     keepWhite: true,
@@ -338,6 +353,8 @@ Packer.prototype = {
             }
             
         }
+        print("Output file: " + this.target);
+        if (this.debugTarget) print("Output debug file: " + this.debugTarget);
         
          
     
@@ -360,7 +377,8 @@ Packer.prototype = {
             keepWhite : true,  
             keepComments : true, 
             sepIdents : true,
-            collapseWhite : false
+            collapseWhite : false,
+            filename : fn
         });
         this.timerPrint("START" + fn);
         
@@ -396,6 +414,7 @@ Packer.prototype = {
         
         var out = CompressWhite(new TokenStream(toks), this, this.keepWhite); // do not kill whitespace..
         
+        
         this.timerPrint("Compressed");
         return out;