Merge branch 'live' of http://private.akbkhome.com/gnome.introspection-doc-generator...
[gnome.introspection-doc-generator] / JSDOC / Packer.js
index 64929ae..f7a3246 100644 (file)
@@ -10,6 +10,7 @@ CompressWhite   = imports.CompressWhite.CompressWhite;
 Collapse        = imports.Collapse.Collapse;
 
 GLib = imports.gi.GLib;
+Gio = imports.gi.Gio;
 /**
  * @namespace JSDOC
  * @class  Packer
@@ -83,16 +84,16 @@ Packer = function(cfg)
         throw "No Files";
     }
     
+    var link = false;
     if (cfg.autoBuild) {
         var version = 0;
         this.files.forEach(function(f) {
-            print(f);
             version = Math.max(File.mtime(f), 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)) {
+         if (File.exists(this.target)) {
             print("Target file already exists");
             Seed.quit();
         }
@@ -101,10 +102,12 @@ Packer = function(cfg)
         
     }
      
-    
+    print(this.translateJSON);
     this.timer =  new Date() * 1;
     this.packAll();
     
+    
+    
  
 }
 Packer.prototype = {
@@ -147,6 +150,12 @@ Packer.prototype = {
      *    Defaults to false if you set tmpDir, otherwise true.
      */
     cleanup : true,  
+    /**
+     * @cfg {Boolean} keepWhite (optional) do not remove white space in output.
+     *    usefull for debugging compressed files.
+     */
+    
+    keepWhite: true,
     
     /**
      * @cfg {String} prefix (optional) prefix of directory to be stripped of when
@@ -385,8 +394,8 @@ Packer.prototype = {
         print(sp.warnings.join("\n"));
         
         
-        //var out = CompressWhite(new TokenStream(toks), this, true); // do not kill whitespace..
-        var out = CompressWhite(new TokenStream(toks), this, false);
+        var out = CompressWhite(new TokenStream(toks), this, this.keepWhite); // do not kill whitespace..
+        
         this.timerPrint("Compressed");
         return out;