Skip to content

Commit 7514c2b

Browse files
authored
Merge pull request #578 from wytlytningNZ/fix/configure-code-sign-identity-correctly
Option 2: Configure the declaration of the code sign identity correctly
2 parents dbbdae2 + 1e988e0 commit 7514c2b

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/scripts/ios/enableEntitlements.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
const compare = require("node-version-compare");
66
const IOS_DEPLOYMENT_TARGET = "8.0";
77
const COMMENT_KEY = /_comment$/;
8-
const CODESIGNIDENTITY = "iPhone Developer";
8+
const DEBUGCODESIGNIDENTITY = "iPhone Developer";
9+
const RELEASECODESIGNIDENTITY = "iPhone Distribution";
910

1011
// entry
1112
module.exports = {
@@ -37,13 +38,21 @@
3738
xcodeProject.pbxXCBuildConfigurationSection()
3839
);
3940
let config;
41+
let configurationConfig;
4042
let buildSettings;
4143

4244
for (config in configurations) {
43-
buildSettings = configurations[config].buildSettings;
44-
buildSettings.CODE_SIGN_IDENTITY = `"${CODESIGNIDENTITY}"`;
45+
configurationConfig = configurations[config];
46+
buildSettings = configurationConfig.buildSettings;
47+
4548
buildSettings.CODE_SIGN_ENTITLEMENTS = `"${entitlementsFile}"`;
4649

50+
if (configurationConfig.name === 'Release') {
51+
buildSettings.CODE_SIGN_IDENTITY = `"${RELEASECODESIGNIDENTITY}"`;
52+
} else {
53+
buildSettings.CODE_SIGN_IDENTITY = `"${DEBUGCODESIGNIDENTITY}"`;
54+
}
55+
4756
// if deployment target is less then the required one - increase it
4857
if (buildSettings.IPHONEOS_DEPLOYMENT_TARGET) {
4958
const buildDeploymentTarget = buildSettings.IPHONEOS_DEPLOYMENT_TARGET.toString();

0 commit comments

Comments
 (0)