Skip to content

Commit

Permalink
[TIMOB-25652] iOS: Ad-hoc build fails when packaging with WatchApp 7_…
Browse files Browse the repository at this point in the history
…0_2 (#9757)
  • Loading branch information
feons authored and ewieberappc committed Jan 22, 2018
1 parent bcfe0da commit b4f1299
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions iphone/cli/hooks/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,21 @@ exports.init = function (logger, config, cli) {
exportsOptions.provisioningProfiles = {};
exportsOptions.provisioningProfiles[builder.tiapp.id] = pp.uuid;

builder.extensions.forEach(function (ext) {
const nativeTargets = ext.objs.PBXNativeTarget;
ext.targets.forEach(function (extTarget) {
if (extTarget.ppUUIDs[target]) {
const targetUUID = Object.keys(nativeTargets).filter(uuid => typeof nativeTargets[uuid] === 'object' && nativeTargets[uuid].name.replace(/^"/, '').replace(/"$/, '') === extTarget.name)[0];
const buildConf = targetUUID && ext.objs.XCConfigurationList[nativeTargets[targetUUID].buildConfigurationList].buildConfigurations.filter(c => c.comment === 'Release');
const confUUID = buildConf && buildConf.length && buildConf[0].value;
const id = confUUID && ext.objs.XCBuildConfiguration[confUUID].buildSettings.PRODUCT_BUNDLE_IDENTIFIER;
if (id) {
exportsOptions.provisioningProfiles[id] = extTarget.ppUUIDs[target];
}
}
});
});

// check if the app is using CloudKit
const entitlementsFile = path.join(builder.buildDir, builder.tiapp.name + '.entitlements');
if (fs.existsSync(entitlementsFile)) {
Expand Down

0 comments on commit b4f1299

Please sign in to comment.