press cleanup, refactor setting environments and include paths into analyzer.

This commit is contained in:
Tom Robinson committed 2010-02-13 13:13:47 -08:00
1 parent 64dc25dfb6
commit cb1d3168e3
2 files changed
+12 -6

No files matched your search

+4 -6
View File
@@ -6,16 +6,14 @@ require("narwhal").ensureEngine("rhino");
@import "objj-analysis-tools.j"
@import "cib-analysis-tools.j"
var ARGS = require("args");
var FILE = require("file");
var OS = require("os");
var stream = require("term").stream;
var parser = new ARGS.Parser();
var parser = new (require("args").Parser)();
parser.usage("INPUT_PROJECT OUTPUT_PROJECT");
parser.help("Optimizes Cappuccino applications for deployment to the web.");
parser.help("Analyze and strip unused files from a Cappuccino project's .sj bundles.");
parser.option("-m", "--main", "main")
.def("main.j")
@@ -138,9 +136,9 @@ function pressEnvironment(rootPath, outputFiles, environment, options) {
var _OBJJ = analyzer.require("objective-j");
// include paths:
analyzer.context.global.OBJJ_INCLUDE_PATHS = frameworks;
analyzer.setIncludePaths(frameworks);
// environments:
_OBJJ.environments = function() { return [environment, "ObjJ"] };
analyzer.setEnvironments([environment, "ObjJ"]);
// build list of cibs to inspect for dependent classes
// FIXME: what's the best way to determine which cibs to look in?
+8
View File
@@ -12,6 +12,14 @@ function ObjectiveJRuntimeAnalyzer(rootPath)
this.require = this.context.global.require;
}
ObjectiveJRuntimeAnalyzer.prototype.setIncludePaths = function(includePaths) {
this.context.global.OBJJ_INCLUDE_PATHS = includePaths;
}
ObjectiveJRuntimeAnalyzer.prototype.setEnvironments = function(environments) {
this.require("objective-j").environments = function() { return environments; };
}
ObjectiveJRuntimeAnalyzer.prototype.initializeGlobalRecorder = function()
{
this.initializeGlobalRecorder = function(){}; // run once