From f02286e3f551ff433e4df04e242bc8209d020ecd Mon Sep 17 00:00:00 2001 From: Francisco Ryan Tolmasky I Date: Sun, 7 Mar 2010 14:33:39 -0800 Subject: [PATCH] Update press to support new fileExecutableSearcher style. Reviewed by me. --- CommonJS/bin/press | 14 +++++++++----- CommonJS/lib/cappuccino/objj-analysis-tools.j | 12 ++++++++++-- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CommonJS/bin/press b/CommonJS/bin/press index 853ca8616..7db9a4137 100755 --- a/CommonJS/bin/press +++ b/CommonJS/bin/press @@ -270,13 +270,17 @@ function pressEnvironment(rootPath, outputFiles, environment, options) { stream.print("Stripping extra imports from \0blue(" + path + "\0)"); var code = executable.code(); - var dependencies = executable.fileDependencies(); + var dependencies = executable.fileDependencies(), + fileExecutableSearcher = executable.fileExecutableSearcher(); for (var i = 0; i < dependencies.length; i++) { var dependency = dependencies[i]; - var dependencyExecutable = new _OBJJ.FileExecutableSearch( - new analyzer.context.global.CFURL(dependency.isLocal() ? FILE.join(FILE.dirname(path), dependency.path()) : dependency.path()), - dependency.isLocal() - ).result(); + var dependencyExecutable = nil; + + fileExecutableSearcher(dependency.URL(), dependency.isLocal(), function(aFileExecutable) + { + dependencyExecutable = aFileExecutable; + }); + var dependencyPath = dependencyExecutable.path(); if (!requiredFiles[dependencyPath]) { stream.print(" -> \0red(" + dependencyPath + "\0)"); diff --git a/CommonJS/lib/cappuccino/objj-analysis-tools.j b/CommonJS/lib/cappuccino/objj-analysis-tools.j index 25f38bbb0..3d70a2322 100644 --- a/CommonJS/lib/cappuccino/objj-analysis-tools.j +++ b/CommonJS/lib/cappuccino/objj-analysis-tools.j @@ -187,8 +187,16 @@ ObjectiveJRuntimeAnalyzer.prototype.mergeLibraryImports = function() ObjectiveJRuntimeAnalyzer.prototype.executableForImport = function(path, isLocal) { if (isLocal === undefined) isLocal = true; - var _OBJJ = this.require("objective-j"); - return new _OBJJ.FileExecutableSearch(new this.context.global.CFURL(path), isLocal).result(); + var _OBJJ = this.require("objective-j"), + fileExecutable = nil, + URL = new this.context.global.CFURL(path); + + _OBJJ.Executable.fileExecutableSearcherForURL(URL)(URL, isLocal, function(/*FileExecutable*/ aFileExecutable) + { + fileExecutable = aFileExecutable; + }); + + return fileExecutable; } /*