Skip to content

Commit

Permalink
Merge pull request #9446 from cb1kenobi/timob-25319
Browse files Browse the repository at this point in the history
[TIMOB-25319] Fixed export options when packaging app that uses Cloud Kit.
  • Loading branch information
ewieberappc committed Sep 20, 2017
2 parents b56b146 + 6a5473b commit 18fe7f5
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
Expand Up @@ -3108,6 +3108,9 @@ iOSBuilder.prototype.createXcodeProject = function createXcodeProject(next) {
xobjs.XCConfigurationList[xobjs.PBXNativeTarget[mainTargetUuid].buildConfigurationList].buildConfigurations.forEach(function (buildConf) {
const 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
Expand Up @@ -224,6 +224,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 18fe7f5

Please sign in to comment.