XObject = imports.XObject.XObject;
File = imports.File.File;
-TextStream = imports.TextStream.TextStream;
+TextStream = imports.JSDOC.TextStream.TextStream ;
TokenReader = imports.TokenReader.TokenReader;
ScopeParser = imports.ScopeParser.ScopeParser;
TokenStream = imports.TokenStream.TokenStream;
files : [ "/location/of/file1.js", "/location/of/file2.js", ... ],
target : "/tmp/output.js",
debugTarget : "/tmp/output.debug.js", // merged file without compression.
+ debugTranslateTarget : "/tmp/output.translate.js", // merged with translation
+ // and no compression
translateJSON: "/tmp/translate.json",
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());
+ return d.getFullYear() +
+ pad(d.getMonth()+1)+
+ pad(d.getDate())+'_'+
+ pad(d.getHours())+
+ pad(d.getMinutes())+
+ pad(d.getSeconds());
}
*/
module: false,
/**
- * @cfg {String} debugTargettarget to write files debug version to (uncompacted)- must be full path.
+ * @cfg {String} debugTarget target to write files debug version to (uncompacted)- must be full path.
*/
debugTarget : '', // merged file without compression.
+ /**
+ * @cfg {String} debugTranslateTarget target to write files debug version
+ * to (uncompacted) but with translation- must be full path.
+ */
+
+ debugTranslateTarget : '',
+
/**
* @cfg {String} tmpDir (optional) where to put the temporary files.
* if you set this, then files will not be cleaned up
if (this.debugTarget) {
File.write(this.debugTarget, "");
}
+ if (this.debugTranslateTarget) {
+ File.write(this.debugTarget, "");
+ }
for(var i=0; i < this.files.length; i++) {
var file = this.files[i];
continue;
}
+ // debug Target
+
if (this.debugTarget) {
File.append(this.debugTarget, File.read(file));
}
print("compare : " + mt + "=>" + ot);
if (mt >= ot) {
continue;
- /*
- // then the min'files time is > than original..
- var str = File.read(minfile);
- print("using MIN FILE "+ minfile);
- if (str.length) {
- File.append(outpath, str + "\n");
- }
- continue;
- */
}
}
-
+
print("COMPRESSING ");
//var codeComp = pack(str, 10, 0, 0);
if (File.exists(minfile)) {
}
var str = File.read(file);
var str = this.pack(str, file, minfile);
+
+
if (str.length) {
File.write(minfile, str);
}
- }
+ }
+
+ // if we are translating, write the translations strings at the top
+ // of the file..
+
if (this.translateJSON) {
} else {
this.out += out;
}
-
-
-
+
File.write(this.translateJSON, "");
for(var i=0; i < this.files.length; i++) {
var file = this.files[i];
this.timerPrint("Compressed");
+
+ if (out.length) {
+ File.write(minfile, str);
+ }
+
return out;