Updated press for changed names.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2010-02-20 02:36:14 -08:00
1 parent 3968d35cac
commit 666e2c0190
2 files changed
+22 -7

No files matched your search

+16 -3
View File
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
var FileExecutablesForPaths = { };
function FileExecutable(/*String*/ aPath)
{
var existingFileExecutable = FileExecutable.fileExecutablesForPaths[aPath];
@@ -27,7 +29,7 @@ function FileExecutable(/*String*/ aPath)
if (existingFileExecutable)
return existingFileExecutable;
FileExecutable.fileExecutablesForPaths[aPath] = this;
FileExecutablesForPaths[aPath] = this;
var fileContents = rootResource.nodeAtSubPath(aPath).contents(),
executable = NULL,
@@ -50,10 +52,21 @@ function FileExecutable(/*String*/ aPath)
exports.FileExecutable = FileExecutable;
FileExecutable.fileExecutablesForPaths = { };
FileExecutable.prototype = new Executable();
#ifdef COMMONJS
FileExecutable.allFileExecutables = function()
{
var fileExecutables = [];
for (path in FileExecutablesForPaths)
if (hasOwnProperty.call(FileExecutablesForPaths, path))
fileExecutables.push(FileExecutablesForPaths[path]);
return fileExecutables;
}
#endif
FileExecutable.prototype.execute = function(/*BOOL*/ shouldForce)
{
if (this._hasExecuted && !shouldForce)
+6 -4
View File
@@ -194,8 +194,10 @@ function pressEnvironment(rootPath, outputFiles, environment, options) {
var included = 0, total = 0;
var includedBytes = 0, totalBytes = 0;
var allFiles = analyzer.fileExecutables();
for (var path in allFiles) {
_OBJJ.FileExecutable.allFileExecutables().forEach(function(aFileExecutable) {
var path = aFileExecutable.path();
// mark all ".keytheme"s as required
if (/\.keyedtheme$/.test(path))
requiredFiles[path] = true;
@@ -203,13 +205,13 @@ function pressEnvironment(rootPath, outputFiles, environment, options) {
if (requiredFiles[path]) {
stream.print("Included: \0green(" + rootPath.relative(path) + "\0)");
included++;
includedBytes += allFiles[path].code().length
includedBytes += aFileExecutable.code().length
}
else {
stream.print("Excluded: \0red(" + rootPath.relative(path) + "\0)");
}
total++;
totalBytes += allFiles[path].code().length
totalBytes += aFileExecutable.code().length
}
stream.print(sprintf(
"Saved \0green(%f%%\0) (\0blue(%s\0)); Total required files: \0magenta(%d\0) (\0blue(%s\0)) of \0magenta(%d\0) (\0blue(%s\0));",