@@ -379,10 +379,9 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
379
379
await this . createIpa ( projectRoot , projectData , buildConfig ) ;
380
380
}
381
381
382
- private async setupSigningFromProvision ( projectRoot : string , projectData : IProjectData , provision ?: any ) : Promise < void > {
382
+ private async setupSigningFromProvision ( projectRoot : string , projectData : IProjectData , provision ?: string ) : Promise < void > {
383
383
if ( provision ) {
384
- const pbxprojPath = path . join ( projectRoot , projectData . projectName + ".xcodeproj" , "project.pbxproj" ) ;
385
- const xcode = Xcode . open ( pbxprojPath ) ;
384
+ const xcode = Xcode . open ( this . getPbxProjPath ( projectData ) ) ;
386
385
const signing = xcode . getSigning ( projectData . projectName ) ;
387
386
388
387
let shouldUpdateXcode = false ;
@@ -428,11 +427,16 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
428
427
}
429
428
430
429
private async setupSigningForDevice ( projectRoot : string , buildConfig : IiOSBuildConfig , projectData : IProjectData ) : Promise < void > {
431
- const pbxprojPath = path . join ( projectRoot , projectData . projectName + ".xcodeproj" , "project.pbxproj" ) ;
432
- const xcode = Xcode . open ( pbxprojPath ) ;
430
+ const xcode = Xcode . open ( this . getPbxProjPath ( projectData ) ) ;
433
431
const signing = xcode . getSigning ( projectData . projectName ) ;
434
432
435
- if ( ( this . readXCConfigProvisioningProfile ( projectData ) || this . readXCConfigProvisioningProfileForIPhoneOs ( projectData ) ) && ( ! signing || signing . style !== "Manual" ) ) {
433
+ const hasProvisioningProfileInXCConfig =
434
+ this . readXCConfigProvisioningProfileSpecifierForIPhoneOs ( projectData ) ||
435
+ this . readXCConfigProvisioningProfileSpecifier ( projectData ) ||
436
+ this . readXCConfigProvisioningProfileForIPhoneOs ( projectData ) ||
437
+ this . readXCConfigProvisioningProfile ( projectData ) ;
438
+
439
+ if ( hasProvisioningProfileInXCConfig && ( ! signing || signing . style !== "Manual" ) ) {
436
440
xcode . setManualSigningStyle ( projectData . projectName ) ;
437
441
xcode . save ( ) ;
438
442
} else if ( ! buildConfig . provision && ! ( signing && signing . style === "Manual" && ! buildConfig . teamId ) ) {
@@ -623,7 +627,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
623
627
624
628
if ( provision ) {
625
629
let projectRoot = path . join ( projectData . platformsDir , "ios" ) ;
626
- await this . setupSigningFromProvision ( projectRoot , provision ) ;
630
+ await this . setupSigningFromProvision ( projectRoot , projectData , provision ) ;
627
631
}
628
632
629
633
let project = this . createPbxProj ( projectData ) ;
@@ -844,6 +848,41 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
844
848
return Promise . resolve ( ) ;
845
849
}
846
850
851
+ public checkForChanges ( changesInfo : IProjectChangesInfo , options : IProjectChangesOptions , projectData : IProjectData ) : void {
852
+ const nextCommandProvisionUUID = options . provision ;
853
+
854
+ if ( typeof nextCommandProvisionUUID === "string" ) {
855
+ const pbxprojPath = this . getPbxProjPath ( projectData ) ;
856
+
857
+ // Check if the native project's signing is set to the provided provision...
858
+ let signingChanged = false ;
859
+ if ( this . $fs . exists ( pbxprojPath ) ) {
860
+ const xcode = Xcode . open ( pbxprojPath ) ;
861
+ const signing = xcode . getSigning ( projectData . projectName ) ;
862
+ if ( signing && signing . style === "Manual" ) {
863
+ for ( let name in signing . configurations ) {
864
+ let config = signing . configurations [ name ] ;
865
+ if ( config . uuid !== nextCommandProvisionUUID && config . name !== nextCommandProvisionUUID ) {
866
+ signingChanged = true ;
867
+ break ;
868
+ }
869
+ }
870
+ } else {
871
+ signingChanged = true ;
872
+ }
873
+ } else {
874
+ signingChanged = true ;
875
+ }
876
+
877
+ if ( signingChanged ) {
878
+ changesInfo . nativeChanged = true ;
879
+ changesInfo . configChanged = true ;
880
+ // TRICKY: The native project is prepared only if appResourcesChanged.
881
+ changesInfo . appResourcesChanged = true ;
882
+ }
883
+ }
884
+ }
885
+
847
886
private getAllLibsForPluginWithFileExtension ( pluginData : IPluginData , fileExtension : string ) : string [ ] {
848
887
let filterCallback = ( fileName : string , pluginPlatformsFolderPath : string ) => path . extname ( fileName ) === fileExtension ;
849
888
return this . getAllNativeLibrariesForPlugin ( pluginData , IOSProjectService . IOS_PLATFORM_NAME , filterCallback ) ;
@@ -1186,6 +1225,14 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1186
1225
return this . readXCConfig ( "PROVISIONING_PROFILE[sdk=iphoneos*]" , projectData ) ;
1187
1226
}
1188
1227
1228
+ private readXCConfigProvisioningProfileSpecifier ( projectData : IProjectData ) : string {
1229
+ return this . readXCConfig ( "PROVISIONING_PROFILE_SPECIFIER" , projectData ) ;
1230
+ }
1231
+
1232
+ private readXCConfigProvisioningProfileSpecifierForIPhoneOs ( projectData : IProjectData ) : string {
1233
+ return this . readXCConfig ( "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" , projectData ) ;
1234
+ }
1235
+
1189
1236
private async getDevelopmentTeam ( projectData : IProjectData , teamId ?: string ) : Promise < string > {
1190
1237
teamId = teamId || this . readTeamId ( projectData ) ;
1191
1238
0 commit comments