Files
cappuccino/Tools/xcodecapp-cocoa/Jakefile
T
2011-07-16 22:53:49 -07:00

54 lines
1.3 KiB
JavaScript

require("../../common.jake");
var OS = require("os");
var task = require("jake").task
var stream = require("narwhal/term").stream;
var applicationName = "xcodecapp-cocoa.app";
task ("build", function()
{
if (executableExists("xcodebuild"))
{
var args = "-alltargets -configuration Release",
supportPath = FILE.join($BUILD_CJS_CAPPUCCINO, "support", applicationName),
installPath = FILE.join("/", "Applications", applicationName);
if (xcodebuildHasTenPointFiveSDK())
args = "-sdk macosx10.5 " + args;
else
args = "-sdk macosx " + args;
if (OS.system("xcodebuild " + args))
OS.exit(1);
rm_rf(supportPath);
FILE.mkdirs(supportPath);
cp_r(FILE.join("build", "Release", "xcodecapp-cocoa.app"), supportPath);
FILE.chmod(FILE.join(supportPath, "Contents", "MacOS", "xcodecapp-cocoa"), 0755);
if (FILE.exists(installPath))
FILE.remove(installPath);
FILE.symlink(supportPath, installPath);
}
else
{
print("Building "+xcodecapp-cocoa+" requires Xcode.");
}
});
task ("clean", function()
{
if (OS.system("xcodebuild clean"))
OS.exit(1);
});
task ("clobber", function()
{
if (OS.system("xcodebuild clean"))
OS.exit(1);
});
task ("default", ["build"]);