Skip to content

Commit

Permalink
Merge branch '8_1_X' into TIMOB-27202-8_1_X
Browse files Browse the repository at this point in the history
  • Loading branch information
lokeshchdhry committed Jul 11, 2019
2 parents 5bc424c + b655c34 commit 94154af
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -1925,17 +1925,22 @@ iOSBuilder.prototype.validate = function validate(logger, config, cli) {

function sortXcodeIds(a, b) {
// prioritize selected xcode
if (xcodeInfo[a].selected) {
return -1;
}
if (xcodeInfo[b].selected) {
return 1;
}
// newest to oldest
return appc.version.gt(xcodeInfo[a].version, xcodeInfo[b].version) ? -1 : appc.version.lt(xcodeInfo[a].version, xcodeInfo[b].version) ? 1 : 0;
}

const sortedXcodeIds = Object.keys(xcodeInfo).sort(sortXcodeIds);
if (this.iosSdkVersion) {
// find the Xcode for this version
Object.keys(this.iosInfo.xcode).sort(sortXcodeIds).some(function (ver) {
if (this.iosInfo.xcode[ver].sdks.indexOf(this.iosSdkVersion) !== -1) {
this.xcodeEnv = this.iosInfo.xcode[ver];
sortedXcodeIds.some(function (ver) {
if (xcodeInfo[ver].sdks.includes(this.iosSdkVersion)) {
this.xcodeEnv = xcodeInfo[ver];
return true;
}
return false;
Expand All @@ -1948,9 +1953,8 @@ iOSBuilder.prototype.validate = function validate(logger, config, cli) {
}

} else { // device, simulator, dist-appstore, dist-adhoc
Object.keys(xcodeInfo)
.filter(function (id) { return xcodeInfo[id].supported; })
.sort(sortXcodeIds)
sortedXcodeIds
.filter(id => xcodeInfo[id].supported)
.some(function (id) {
return xcodeInfo[id].sdks.sort().reverse().some(function (ver) {
if (appc.version.gte(ver, this.minIosVersion)) {
Expand Down

0 comments on commit 94154af

Please sign in to comment.