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

index 897c22d..8ca047d 100644 (file)
@@ -89,7 +89,7 @@ Packer = function(cfg)
             version = Math.max(File.mtime(f), version);
         });
         var dirname = GLib.path_get_dirname(this.files[0]);
-        var outname = GLib.path_get_basename(dirname);
+        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");
@@ -108,12 +108,12 @@ Packer = function(cfg)
 }
 Packer.prototype = {
     /**
-     * @prop srcfiles {String} file containing a list of files/or classes to use.
+     * @cfg {String} srcfiles file containing a list of files/or classes to use.
      */
     srcfile : false,
     
     /**
-     * @prop files {Array} list of files to compress (must be full path)
+     * @cfg {Array} files list of files to compress (must be full path)
      */
     files : false,
     /**
@@ -125,12 +125,16 @@ Packer.prototype = {
      * and enables translation toolkit.
      */
     autoBuild : false,
+     /**
+     * @cfg {String} module used with autoBuild to force a file name
+     */
+    module: false,
     /**
-     * @prop debugTarget {String} target to write files debug version to (uncompacted)- must be full path.
+     * @cfg {String} debugTargettarget to write files debug version to (uncompacted)- must be full path.
      */
     debugTarget : '', // merged file without compression.
     /**
-     * @prop tmpDir {String} (optional) where to put the temporary files. 
+     * @cfg {String} tmpDir  (optional) where to put the temporary files. 
      *      if you set this, then files will not be cleaned up
      */
     tmpDir : '/tmp',
@@ -138,13 +142,13 @@ Packer.prototype = {
     translateJSON : '', // json based list of strings in all files.
    
     /**
-     * @prop cleanup {Boolean} (optional) clean up temp files after done - 
+     * @cfg {Boolean} cleanup  (optional) clean up temp files after done - 
      *    Defaults to false if you set tmpDir, otherwise true.
      */
     cleanup : true,  
     
     /**
-     * @prop prefix {String} (optional) prefix of directory to be stripped of when
+     * @cfg {String} prefix (optional) prefix of directory to be stripped of when
      *    Calculating md5 of filename 
      */
     prefix : '',