Cleanup objj arguments story. objj-executable and "objj path/to/main.j" are now consistent.

This commit is contained in:
Tom Robinson committed 2010-01-27 17:53:05 -08:00
1 parent 8e87a4a941
commit ee5817e480
3 files changed
+14 -13

No files matched your search

+7
View File
@@ -112,6 +112,13 @@ exports.run = function(args)
{
if (args && args.length > 1)
{
// we expect args to be in the format:
// 1) "objj" path
// 2) optional "-I" args
// 3) real or "virtual" main.j
// 4) optional program arguments
// copy the args since we're going to modify them
var argv = args.slice(1);
while (argv.length && argv[0].indexOf('-I') === 0)
+4 -12
View File
@@ -1,15 +1,7 @@
#!/usr/bin/env narwhal
var FILE = require("file");
var execPath = require("file").path(module.path);
var mainPath = execPath.dirname().dirname().join("lib", execPath.basename(), "main.j");
var cappuccinoPackage = FILE.path(module.path).dirname().dirname();
var mainPath = cappuccinoPackage.join("lib", FILE.basename(module.path), "main.j");
var frameworksPath = cappuccinoPackage.join("Frameworks");
// TODO: is specifying the Frameworks necessary?
system.args.splice(1, 0, "-I"+frameworksPath, String(mainPath));
// HACK: remove use of SELF_HOME from capp gen
system.env["SELF_HOME"] = cappuccinoPackage;
require("objective-j").run(system.args);
var args = ["objj", String(mainPath)].concat(system.args.slice(1));
require("objective-j").run(args);
+3 -1
View File
@@ -6,6 +6,8 @@ var OS = require("os"),
FILE = require("file"),
OBJJ = require("objective-j");
// FIXME: better way to do this:
var CAPP_HOME = require("packages").catalog["cappuccino"].directory;
function gen(/*va_args*/)
{
@@ -56,7 +58,7 @@ function gen(/*va_args*/)
if (FILE.isAbsolute(template))
sourceTemplate = FILE.join(template);
else
sourceTemplate = FILE.join(SYSTEM.env["SELF_HOME"], "lib", "capp", "Resources", "Templates", template);
sourceTemplate = FILE.join(CAPP_HOME, "lib", "capp", "Resources", "Templates", template);
var configFile = FILE.join(sourceTemplate, "template.config"),
config = {};