From 289a6ca52de01758e36c992a63a8a532fba17660 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 27 Jul 2010 12:55:19 +0800 Subject: [PATCH] JSDOC/Packer.js --- JSDOC/Packer.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/JSDOC/Packer.js b/JSDOC/Packer.js index 5a21132..4a5d0b4 100644 --- a/JSDOC/Packer.js +++ b/JSDOC/Packer.js @@ -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) { -- 2.39.2