Skip to content

Commit 2adfc16

Browse files
Pass mobileProvisionData to prepare (#2895)
On Windows and Linux we are unable to execute macOS specific commands. During project preparation for iOS we need to know the data from specified provison. In this scenario, pass the data from it as a non mandatory parameter. This way the default behavior will be kept, but we'll have a way to skip the `security` command which fails on Windows.
1 parent 32569e4 commit 2adfc16

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/definitions/platform.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ interface IPlatformSpecificData {
228228
* Target SDK for Android.
229229
*/
230230
sdk: string;
231+
232+
/**
233+
* Data from mobileProvision.
234+
*/
235+
mobileProvisionData?: any;
231236
}
232237

233238
/**

lib/services/ios-project-service.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { IOSProvisionService } from "./ios-provision-service";
1414
import { IOSEntitlementsService } from "./ios-entitlements-service";
1515
import { XCConfigService } from "./xcconfig-service";
1616
import * as simplePlist from "simple-plist";
17+
import * as mobileprovision from "ios-mobileprovision-finder";
1718

1819
export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase implements IPlatformProjectService {
1920
private static XCODE_PROJECT_EXT_NAME = ".xcodeproj";
@@ -392,7 +393,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
392393
await this.createIpa(projectRoot, projectData, buildConfig);
393394
}
394395

395-
private async setupSigningFromProvision(projectRoot: string, projectData: IProjectData, provision?: string): Promise<void> {
396+
private async setupSigningFromProvision(projectRoot: string, projectData: IProjectData, provision?: string, mobileProvisionData?: mobileprovision.provision.MobileProvision): Promise<void> {
396397
if (provision) {
397398
const xcode = this.$pbxprojDomXcode.Xcode.open(this.getPbxProjPath(projectData));
398399
const signing = xcode.getSigning(projectData.projectName);
@@ -412,7 +413,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
412413

413414
if (shouldUpdateXcode) {
414415
const pickStart = Date.now();
415-
const mobileprovision = await this.$iOSProvisionService.pick(provision, projectData.projectId);
416+
const mobileprovision = mobileProvisionData || await this.$iOSProvisionService.pick(provision, projectData.projectId);
416417
const pickEnd = Date.now();
417418
this.$logger.trace("Searched and " + (mobileprovision ? "found" : "failed to find ") + " matching provisioning profile. (" + (pickEnd - pickStart) + "ms.)");
418419
if (!mobileprovision) {
@@ -638,7 +639,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
638639

639640
if (provision) {
640641
let projectRoot = path.join(projectData.platformsDir, "ios");
641-
await this.setupSigningFromProvision(projectRoot, projectData, provision);
642+
await this.setupSigningFromProvision(projectRoot, projectData, provision, platformSpecificData.mobileProvisionData);
642643
}
643644

644645
let project = this.createPbxProj(projectData);

0 commit comments

Comments
 (0)