JSDOC/Packer.js
authorAlan Knowles <alan@akbkhome.com>
Tue, 27 Jul 2010 04:55:19 +0000 (12:55 +0800)
committerAlan Knowles <alan@akbkhome.com>
Tue, 27 Jul 2010 04:55:19 +0000 (12:55 +0800)
JSDOC/Packer.js

index 5a21132..4a5d0b4 100644 (file)
@@ -83,9 +83,18 @@ Packer = function(cfg)
         throw "No Files";
     }
     
-    if cfg.
-    
-    
+    if (cfg.autoBuild) {
+        var version = 0;
+        this.files.forEach(function(f) {
+            version = Math.max(File.mtime(f), version);
+        });
+        var dirname = GLib.dirname(this.files[0]);
+        var outname = GLib.basename(this.files[0]);
+        this.target = dirname + '/compiled/' + outname + '-' + version + '.js';
+        
+        this.translateJSON  = dirname + '/compiled/_translation_.js';
+        
+    }
     
     
     this.timer =  new Date() * 1;
@@ -111,7 +120,7 @@ Packer.prototype = {
      * @cfg {Boolean} autoBuild - turn on autobuild feature (puts files in compiled directory,
      * and enables translation toolkit.
      */
-    target : '',
+    autoBuild : false,
     /**
      * @prop debugTarget {String} target to write files debug version to (uncompacted)- must be full path.
      */
@@ -137,6 +146,11 @@ Packer.prototype = {
     prefix : '',  
     out : '', // if no target is specified - then this will contain the result
     
+    /**
+     * load a dependancy list -f option
+     * @param {String} srcfile sourcefile to parse
+     * 
+     */
     
     loadSourceFile : function(srcfile)
     {