Files
cappuccino/Tools/XcodeCapp/Jakefile
T
David RichardsonandMartin Carlberg de36a2f4d1 Fixed: Update XcodeCapp code and Jakefile to install properly and launch without crashing when built with Xcode 10/ macOSSDK10.14 (#2773)
Disable YRKSpinningProgressIndicator threaded animation (causing immediate crash on launch since Xcode 10 beta 6).
Simplify Jakefile build process to 'xcodebuild install' to avoid permissions problems when building (still requires sudo when using Cappuccino defaults).
Increment version number to 4.0.1 to reflect minor nature of change.
Update About window version number field to fully display and properly align longer version numbers.
2018-09-03 10:29:43 +02:00

76 lines
2.0 KiB
JavaScript

require("../../common.jake");
var OS = require("os"),
task = require("jake").task,
stream = require("narwhal/term").stream,
applicationName = "XcodeCapp.app";
task ("build", function()
{
// If sw_vers does not exist, we aren't on Mac OS X
if (!executableExists("sw_vers"))
OS.exit(0);
// No building on 10.6
try
{
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+. You can download the binary here: https://www.dropbox.com/sh/gxdgm356gyb9tqc/rFNyl8hcVG", "red");
p.stdin.close();
p.stdout.close();
p.stderr.close();
OS.exit(0);
}
}
}
finally
{
p.stdin.close();
p.stdout.close();
p.stderr.close();
}
if (executableExists("xcodebuild"))
{
var args = installPath = FILE.join("/", "Applications", applicationName);
// Remove old symlink, if present.
//The application is now built directly into /Applications
if (FILE.isLink(installPath))
FILE.remove(installPath);
if (!OS.system("xcodebuild install"))
colorPrint("Unable to build XcodeCapp. Skipping", "orange");
}
else
{
print("Building " + applicationName + " requires Xcode.");
}
});
task ("clean", function()
{
if (OS.system("xcodebuild clean"))
colorPrint("Unable to clean XcodeCapp. Skipping", "orange");
});
task ("clobber", function()
{
if (OS.system("xcodebuild clean"))
colorPrint("Unable to clean XcodeCapp. Skipping", "orange");
});
task ("default", ["build"]);