Skip to content

Commit 7bb07e1

Browse files
Parse cocoapods beta versions correctly
Cocoapods have versions like 1.0.0.beta.8, which are not valid semver versions. Use only the major.minor.patch part of the versions as all 1.0.0 betas work correctly with XCode 7.3
1 parent 9202b9a commit 7bb07e1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/services/ios-project-service.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,13 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
677677
let cocoapodsVer = this.$sysInfo.getSysInfo(this.$staticConfig.pathToPackageJson).wait().cocoapodVer,
678678
xcodeVersion = this.$xcodeSelectService.getXcodeVersion().wait();
679679

680+
if(!semver.valid(cocoapodsVer)) {
681+
// Cocoapods betas have names like 1.0.0.beta.8
682+
// These 1.0.0 betas are not valid semver versions, but they are working fine with XCode 7.3
683+
// So get only the major.minor.patch version and consider them as 1.0.0
684+
cocoapodsVer = _.take(cocoapodsVer.split("."), 3).join(".");
685+
}
686+
680687
xcodeVersion.patch = xcodeVersion.patch || "0";
681688
let shouldUseXcproj = semver.lt(cocoapodsVer, "1.0.0") && ~helpers.versionCompare(xcodeVersion, "7.3.0");
682689

0 commit comments

Comments
 (0)