Skip to content

Commit

Permalink
Merge pull request #9447 from cb1kenobi/timob-25319_6_3_X
Browse files Browse the repository at this point in the history
[TIMOB-25319] (6_3_X) Fixed export options when packaging app that uses CloudKit.
  • Loading branch information
ewieberappc committed Sep 20, 2017
2 parents 563459c + 82c11f2 commit b9d4cd7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3086,6 +3086,9 @@ iOSBuilder.prototype.createXcodeProject = function createXcodeProject(next) {
xobjs.XCConfigurationList[xobjs.PBXNativeTarget[mainTargetUuid].buildConfigurationList].buildConfigurations.forEach(function (buildConf) {
var bs = appc.util.mix(xobjs.XCBuildConfiguration[buildConf.value].buildSettings, buildSettings);
delete bs['"CODE_SIGN_IDENTITY[sdk=iphoneos*]"'];

bs.PRODUCT_BUNDLE_IDENTIFIER = '"' + this.tiapp.id + '"';

if (this.provisioningProfile) {
bs.DEVELOPMENT_TEAM = this.provisioningProfile.appPrefix;
bs.PROVISIONING_PROFILE = '"' + this.provisioningProfile.uuid + '"';
Expand Down
9 changes: 9 additions & 0 deletions iphone/cli/hooks/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,15 @@ exports.init = function (logger, config, cli) {
exportsOptions.provisioningProfiles = {};
exportsOptions.provisioningProfiles[builder.tiapp.id] = pp.uuid;

// check if the app is using CloudKit
const entitlementsFile = path.join(builder.buildDir, builder.tiapp.name + '.entitlements');
if (fs.existsSync(entitlementsFile)) {
const plist = new appc.plist(entitlementsFile);
if (Object.keys(plist).indexOf('com.apple.developer.icloud-container-identifiers') !== -1) {
exportsOptions.iCloudContainerEnvironment = 'Production';
}
}

fs.writeFileSync(exportsOptionsPlistFile, exportsOptions.toString('xml'));

// construct the command
Expand Down

0 comments on commit b9d4cd7

Please sign in to comment.