@@ -495,8 +495,6 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
495
495
await this . prepareResources ( pluginPlatformsFolderPath , pluginData , projectData ) ;
496
496
await this . prepareFrameworks ( pluginPlatformsFolderPath , pluginData , projectData ) ;
497
497
await this . prepareStaticLibs ( pluginPlatformsFolderPath , pluginData , projectData ) ;
498
- const platformData = this . getPlatformData ( projectData ) ;
499
- await this . $cocoapodsService . applyPodfileToProject ( pluginData . name , this . $cocoapodsService . getPluginPodfilePath ( pluginData ) , projectData , platformData ) ;
500
498
}
501
499
502
500
public async removePluginNativeCode ( pluginData : IPluginData , projectData : IProjectData ) : Promise < void > {
@@ -512,8 +510,10 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
512
510
513
511
public async handleNativeDependenciesChange ( projectData : IProjectData , opts : IRelease ) : Promise < void > {
514
512
const platformData = this . getPlatformData ( projectData ) ;
515
-
513
+ const pluginsData = await this . getAllInstalledPlugins ( projectData ) ;
516
514
this . setProductBundleIdentifier ( projectData ) ;
515
+
516
+ await this . applyPluginsCocoaPods ( pluginsData , projectData , platformData ) ;
517
517
await this . $cocoapodsService . applyPodfileFromAppResources ( projectData , platformData ) ;
518
518
519
519
const projectPodfilePath = this . $cocoapodsService . getProjectPodfilePath ( platformData . projectRoot ) ;
@@ -528,7 +528,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
528
528
529
529
const pbxProjPath = this . getPbxProjPath ( projectData ) ;
530
530
this . $iOSExtensionsService . removeExtensions ( { pbxProjPath } ) ;
531
- await this . addExtensions ( projectData ) ;
531
+ await this . addExtensions ( projectData , pluginsData ) ;
532
532
}
533
533
534
534
public beforePrepareAllPlugins ( ) : Promise < void > {
@@ -641,18 +641,17 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
641
641
this . savePbxProj ( project , projectData ) ;
642
642
}
643
643
644
- private async addExtensions ( projectData : IProjectData ) : Promise < void > {
644
+ private async addExtensions ( projectData : IProjectData , pluginsData : IPluginData [ ] ) : Promise < void > {
645
645
const resorcesExtensionsPath = path . join (
646
646
projectData . getAppResourcesDirectoryPath ( ) ,
647
647
this . getPlatformData ( projectData ) . normalizedPlatformName , constants . NATIVE_EXTENSION_FOLDER
648
648
) ;
649
649
const platformData = this . getPlatformData ( projectData ) ;
650
650
const pbxProjPath = this . getPbxProjPath ( projectData ) ;
651
651
const addedExtensionsFromResources = await this . $iOSExtensionsService . addExtensionsFromPath ( { extensionsFolderPath : resorcesExtensionsPath , projectData, platformData, pbxProjPath } ) ;
652
- const plugins = await this . getAllInstalledPlugins ( projectData ) ;
653
652
let addedExtensionsFromPlugins = false ;
654
- for ( const pluginIndex in plugins ) {
655
- const pluginData = plugins [ pluginIndex ] ;
653
+ for ( const pluginIndex in pluginsData ) {
654
+ const pluginData = pluginsData [ pluginIndex ] ;
656
655
const pluginPlatformsFolderPath = pluginData . pluginPlatformsFolderPath ( IOSProjectService . IOS_PLATFORM_NAME ) ;
657
656
658
657
const extensionPath = path . join ( pluginPlatformsFolderPath , constants . NATIVE_EXTENSION_FOLDER ) ;
@@ -828,6 +827,15 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
828
827
this . $logger . warn ( "[WARNING]: The CFBundleIdentifier key inside the 'Info.plist' will be overriden by the 'id' inside 'package.json'." ) ;
829
828
}
830
829
}
830
+
831
+ private async applyPluginsCocoaPods ( pluginsData : IPluginData [ ] , projectData : IProjectData , platformData : IPlatformData ) {
832
+ for ( const pluginIndex in pluginsData ) {
833
+ const pluginData = pluginsData [ pluginIndex ] ;
834
+ if ( this . $fs . exists ( pluginData . pluginPlatformsFolderPath ( platformData . normalizedPlatformName ) ) ) {
835
+ await this . $cocoapodsService . applyPodfileToProject ( pluginData . name , this . $cocoapodsService . getPluginPodfilePath ( pluginData ) , projectData , platformData ) ;
836
+ }
837
+ }
838
+ }
831
839
}
832
840
833
841
$injector . register ( "iOSProjectService" , IOSProjectService ) ;
0 commit comments