mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
There are features of Objective-C 2.0 used in XcodeCapp that cannot be compiled with Xcode 4.2, which is the maximum version that runs on OS X 10.6. Users on 10.6 would see compile errors. Now a check for OS X 10.7+ is done, and on any version earlier than that, the user is presented with a message telling them to download XcodeCapp from the web site.
59 lines
1.5 KiB
JavaScript
59 lines
1.5 KiB
JavaScript
|
|
require("../../common.jake");
|
|
|
|
var OS = require("os"),
|
|
task = require("jake").task,
|
|
stream = require("narwhal/term").stream,
|
|
applicationName = "XcodeCapp.app";
|
|
|
|
task ("build", function()
|
|
{
|
|
// No building on 10.6
|
|
var p = OS.popen(["sw_vers", "-productVersion"]);
|
|
|
|
if (p.wait() === 0)
|
|
{
|
|
var versions = p.stdout.read().split("."),
|
|
majorVersion = parseInt(versions[0], 10),
|
|
minorVersion = parseInt(versions[1], 10),
|
|
buildVersion = parseInt(versions[2], 10);
|
|
|
|
if (majorVersion < 10 || minorVersion < 7)
|
|
{
|
|
colorPrint("XcodeCapp can only be built on Mac OS X 10.7+. Please go to www.cappuccino-project.org to download the latest XcodeCapp.", "red");
|
|
OS.exit(0);
|
|
}
|
|
}
|
|
|
|
if (executableExists("xcodebuild"))
|
|
{
|
|
var args = "-sdk macosx -alltargets -configuration Release",
|
|
installPath = FILE.join("/", "Applications", applicationName);
|
|
|
|
// Remove an old symlink, the application is built directly into /Applications now.
|
|
if (FILE.isLink(installPath))
|
|
FILE.remove(installPath);
|
|
|
|
if (OS.system("xcodebuild " + args))
|
|
OS.exit(1);
|
|
}
|
|
else
|
|
{
|
|
print("Building " + applicationName + " 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"]);
|