Skip to content

Commit 8856e4c

Browse files
Rebase on latest master
1 parent 8ab23f8 commit 8856e4c

File tree

2 files changed

+43
-47
lines changed

2 files changed

+43
-47
lines changed

lib/common

lib/services/ios-project-service.ts

Lines changed: 42 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,9 +1001,9 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
10011001
if (this.$options.teamId) {
10021002
buildConfig.teamIdentifier = this.$options.teamId;
10031003
} else {
1004-
buildConfig = this.readXCConfigSigning().wait();
1004+
buildConfig = this.readXCConfigSigning();
10051005
if (!buildConfig.codeSignIdentity && !buildConfig.mobileProvisionIdentifier && !buildConfig.teamIdentifier) {
1006-
buildConfig = this.readBuildConfigFromPlatforms().wait();
1006+
buildConfig = this.readBuildConfigFromPlatforms();
10071007
}
10081008
}
10091009

@@ -1091,31 +1091,29 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
10911091
return null;
10921092
}
10931093

1094-
private readXCConfigSigning(): IFuture<IiOSBuildConfig> {
1095-
return (() => {
1096-
const result: IiOSBuildConfig = {};
1097-
let xcconfigFile = path.join(this.$projectData.appResourcesDirectoryPath, this.platformData.normalizedPlatformName, "build.xcconfig");
1098-
if (this.$fs.exists(xcconfigFile).wait()) {
1099-
let text = this.$fs.readText(xcconfigFile).wait();
1100-
text.split(/\r?\n/).forEach((line) => {
1101-
line = line.replace(/\/(\/)[^\n]*$/, "");
1102-
const read = (name: string) => {
1103-
if (line.indexOf(name) >= 0) {
1104-
let value = line.substr(line.lastIndexOf("=") + 1).trim();
1105-
if (value.charAt(value.length - 1) === ';') {
1106-
value = value.substr(0, value.length - 1).trim();
1107-
}
1108-
return value;
1094+
private readXCConfigSigning(): IiOSBuildConfig {
1095+
const result: IiOSBuildConfig = {};
1096+
let xcconfigFile = path.join(this.$projectData.appResourcesDirectoryPath, this.platformData.normalizedPlatformName, "build.xcconfig");
1097+
if (this.$fs.exists(xcconfigFile)) {
1098+
let text = this.$fs.readText(xcconfigFile);
1099+
text.split(/\r?\n/).forEach((line) => {
1100+
line = line.replace(/\/(\/)[^\n]*$/, "");
1101+
const read = (name: string) => {
1102+
if (line.indexOf(name) >= 0) {
1103+
let value = line.substr(line.lastIndexOf("=") + 1).trim();
1104+
if (value.charAt(value.length - 1) === ';') {
1105+
value = value.substr(0, value.length - 1).trim();
11091106
}
1110-
return undefined;
1111-
};
1112-
result.teamIdentifier = read("DEVELOPMENT_TEAM") || result.teamIdentifier;
1113-
result.codeSignIdentity = read("CODE_SIGN_IDENTITY") || result.codeSignIdentity;
1114-
result.mobileProvisionIdentifier = read("PROVISIONING_PROFILE[sdk=iphoneos*]") || result.mobileProvisionIdentifier;
1115-
});
1116-
}
1117-
return result;
1118-
}).future<provision.MobileProvision>()();
1107+
return value;
1108+
}
1109+
return undefined;
1110+
};
1111+
result.teamIdentifier = read("DEVELOPMENT_TEAM") || result.teamIdentifier;
1112+
result.codeSignIdentity = read("CODE_SIGN_IDENTITY") || result.codeSignIdentity;
1113+
result.mobileProvisionIdentifier = read("PROVISIONING_PROFILE[sdk=iphoneos*]") || result.mobileProvisionIdentifier;
1114+
});
1115+
}
1116+
return result;
11191117
}
11201118

11211119
private getProvisioningProfile(): IFuture<provision.MobileProvision> {
@@ -1192,13 +1190,13 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
11921190
switch (choicesPersist.indexOf(choicePersist)) {
11931191
case 0:
11941192
let xcconfigFile = path.join(this.$projectData.appResourcesDirectoryPath, this.platformData.normalizedPlatformName, "build.xcconfig");
1195-
this.$fs.appendFile(xcconfigFile, "\nPROVISIONING_PROFILE[sdk=iphoneos*] = " + uuid + "\n").wait();
1193+
this.$fs.appendFile(xcconfigFile, "\nPROVISIONING_PROFILE[sdk=iphoneos*] = " + uuid + "\n");
11961194
break;
11971195
case 1:
1198-
this.$fs.writeFile(path.join(this.platformData.projectRoot, "mobileprovision"), uuid).wait();
1196+
this.$fs.writeFile(path.join(this.platformData.projectRoot, "mobileprovision"), uuid);
11991197
const teamidPath = path.join(this.platformData.projectRoot, "teamid");
1200-
if (this.$fs.exists(teamidPath).wait()) {
1201-
this.$fs.deleteFile(teamidPath).wait();
1198+
if (this.$fs.exists(teamidPath)) {
1199+
this.$fs.deleteFile(teamidPath);
12021200
}
12031201
break;
12041202
default:
@@ -1218,13 +1216,13 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
12181216
switch (choicesPersist.indexOf(choicePersist)) {
12191217
case 0:
12201218
let xcconfigFile = path.join(this.$projectData.appResourcesDirectoryPath, this.platformData.normalizedPlatformName, "build.xcconfig");
1221-
this.$fs.appendFile(xcconfigFile, "\nDEVELOPMENT_TEAM = " + teamId + "\n").wait();
1219+
this.$fs.appendFile(xcconfigFile, "\nDEVELOPMENT_TEAM = " + teamId + "\n");
12221220
break;
12231221
case 1:
1224-
this.$fs.writeFile(path.join(this.platformData.projectRoot, "teamid"), teamId).wait();
1222+
this.$fs.writeFile(path.join(this.platformData.projectRoot, "teamid"), teamId);
12251223
const mobileprovisionPath = path.join(this.platformData.projectRoot, "mobileprovision");
1226-
if (this.$fs.exists(mobileprovisionPath).wait()) {
1227-
this.$fs.deleteFile(mobileprovisionPath).wait();
1224+
if (this.$fs.exists(mobileprovisionPath)) {
1225+
this.$fs.deleteFile(mobileprovisionPath);
12281226
}
12291227
break;
12301228
default:
@@ -1233,18 +1231,16 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
12331231
}).future<void>()();
12341232
}
12351233

1236-
private readBuildConfigFromPlatforms(): IFuture<IiOSBuildConfig> {
1237-
return (() => {
1238-
let mobileprovisionPath = path.join(this.platformData.projectRoot, "mobileprovision");
1239-
if (this.$fs.exists(mobileprovisionPath).wait()) {
1240-
return { mobileProvisionIdentifier: this.$fs.readText(mobileprovisionPath).wait() };
1241-
}
1242-
let teamidPath = path.join(this.platformData.projectRoot, "teamid");
1243-
if (this.$fs.exists(teamidPath).wait()) {
1244-
return { teamIdentifier: this.$fs.readText(teamidPath).wait() };
1245-
}
1246-
return <IiOSBuildConfig>{};
1247-
}).future<IiOSBuildConfig>()();
1234+
private readBuildConfigFromPlatforms(): IiOSBuildConfig {
1235+
let mobileprovisionPath = path.join(this.platformData.projectRoot, "mobileprovision");
1236+
if (this.$fs.exists(mobileprovisionPath)) {
1237+
return { mobileProvisionIdentifier: this.$fs.readText(mobileprovisionPath) };
1238+
}
1239+
let teamidPath = path.join(this.platformData.projectRoot, "teamid");
1240+
if (this.$fs.exists(teamidPath)) {
1241+
return { teamIdentifier: this.$fs.readText(teamidPath) };
1242+
}
1243+
return <IiOSBuildConfig>{};
12481244
}
12491245
}
12501246

0 commit comments

Comments
 (0)