I'm using rhino for a build dependency on a project I'm working on. Rhino is building a javascript application for me and part of that process is running yui-compressor - so this post is about calling yui-compressor from Rhino.
I couldn't get loadClass to accept the 'resolve' boolean so I've been reduced to the following to get something working:
var COMPRESS = new Object();
COMPRESS['yuicompress'] = ["-jar", JSLIBS+'/bin/yuicompressor-2.4.8pre.jar'];
var YUICOMPRESS_OPTIONS = [
"--nomunge", // Minify only, do not obfuscate
"--preserve-semi", // Preserve all semicolons
"--disable-optimizations", // Disable all micro optimizations
];
var compressCMD = COMPRESS['yuicompress'];
if (YUICOMPRESS_OPTIONS.length > 0) {
if (YUICOMPRESS_OPTIONS.length == 1) {
compressCMD.push(YUICOMPRESS_OPTIONS);
}
else {
compressCMD.concat(YUICOMPRESS_OPTIONS);
}
}
compressCMD.push([infile]);
var options = new Array();
options['args'] = compressCMD;
options['output'] = "";
runCommand("java", options);
//print(options['output']);
var w = new java.io.FileWriter(outfile);
try
{
w.write(options['output']);
}
finally
{
w.close();
}
return;
Setting up PostgreSQL 12 Beta 3 for Testing in Amazon RDS
-
One of the amazing things about the PostgreSQL community is launching
releases like clockwork. On 8/8/2019 the PostgreSQL community not only
launched the ...
5 years ago
No comments:
Post a Comment