Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-16130] Fixed bug where iOS environment assertions were being thro... #5190

Merged
merged 1 commit into from
Jan 7, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 16 additions & 6 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,22 @@ iOSBuilder.prototype.config = function config(logger, config, cli) {
this.ignoreDirs = new RegExp(config.get('cli.ignoreDirs'));
this.ignoreFiles = new RegExp(config.get('cli.ignoreFiles'));

// we hook into the pre-validate event so that we can stop the build before
// prompting if we know the build is going to fail.
cli.on('cli:pre-validate', function (obj, callback) {
if (cli.argv.platform && !/^(ios|iphone|ipad)$/i.test(cli.argv.platform)) {
return callback();
}

// check that the iOS environment is found and sane
this.assertIssue(this.iosInfo.issues, 'IOS_XCODE_NOT_INSTALLED');
this.assertIssue(this.iosInfo.issues, 'IOS_NO_SUPPORTED_XCODE_FOUND');
this.assertIssue(this.iosInfo.issues, 'IOS_NO_IOS_SDKS');
this.assertIssue(this.iosInfo.issues, 'IOS_NO_IOS_SIMS');

callback();
}.bind(this));

var targetDeviceCache = {};
findTargetDevices = function findTargetDevices(target, callback) {
if (targetDeviceCache[target]) {
Expand Down Expand Up @@ -179,12 +195,6 @@ iOSBuilder.prototype.config = function config(logger, config, cli) {
detect.detectSimulators(config, null, function (err, simInfo) {
this.iosInfo = iosInfo;

// check that the iOS environment is found and sane
this.assertIssue(iosInfo.issues, 'IOS_XCODE_NOT_INSTALLED');
this.assertIssue(iosInfo.issues, 'IOS_NO_SUPPORTED_XCODE_FOUND');
this.assertIssue(iosInfo.issues, 'IOS_NO_IOS_SDKS');
this.assertIssue(iosInfo.issues, 'IOS_NO_IOS_SIMS');

// get the all installed iOS SDKs and Simulators across all Xcode versions
var allSdkVersions = {},
sdkVersions = {},
Expand Down