@@ -800,6 +800,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
800
800
}
801
801
802
802
this . $pluginVariablesService . interpolateAppIdentifier ( this . getPlatformData ( projectData ) . configurationFilePath , projectData . projectIdentifiers . ios ) ;
803
+ await this . mergeProjectPodFile ( projectData ) ;
803
804
}
804
805
805
806
private getInfoPlistPath ( projectData : IProjectData ) : string {
@@ -977,29 +978,9 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
977
978
}
978
979
979
980
public async afterPrepareAllPlugins ( projectData : IProjectData ) : Promise < void > {
980
- await this . installPodsIfAny ( projectData ) ;
981
- }
982
-
983
- public async installPodsIfAny ( projectData : IProjectData ) : Promise < void > {
984
981
const projectRoot = this . getPlatformData ( projectData ) . projectRoot ;
985
- const mainPodfilePath = path . join ( projectData . appResourcesDirectoryPath , this . getPlatformData ( projectData ) . normalizedPlatformName , constants . PODFILE_NAME ) ;
986
- if ( this . $fs . exists ( this . $cocoapodsService . getProjectPodfilePath ( projectRoot ) ) || this . $fs . exists ( mainPodfilePath ) ) {
987
- const xcodeProjPath = this . getXcodeprojPath ( projectData ) ;
988
- const xcuserDataPath = path . join ( xcodeProjPath , "xcuserdata" ) ;
989
- const sharedDataPath = path . join ( xcodeProjPath , "xcshareddata" ) ;
990
-
991
- if ( ! this . $fs . exists ( xcuserDataPath ) && ! this . $fs . exists ( sharedDataPath ) ) {
992
- this . $logger . info ( "Creating project scheme..." ) ;
993
- await this . checkIfXcodeprojIsRequired ( ) ;
994
-
995
- const createSchemeRubyScript = `ruby -e "require 'xcodeproj'; xcproj = Xcodeproj::Project.open('${ projectData . projectName } .xcodeproj'); xcproj.recreate_user_schemes; xcproj.save"` ;
996
- await this . $childProcess . exec ( createSchemeRubyScript , { cwd : this . getPlatformData ( projectData ) . projectRoot } ) ;
997
- }
998
-
999
- await this . $cocoapodsService . applyPodfileToProject ( constants . NS_BASE_PODFILE , mainPodfilePath , projectData , this . getPlatformData ( projectData ) . projectRoot ) ;
1000
-
1001
- await this . $cocoapodsService . executePodInstall ( projectRoot , xcodeProjPath ) ;
1002
- }
982
+ const xcodeProjPath = this . getXcodeprojPath ( projectData ) ;
983
+ await this . $cocoapodsService . executePodInstall ( projectRoot , xcodeProjPath ) ;
1003
984
}
1004
985
1005
986
public beforePrepareAllPlugins ( ) : Promise < void > {
@@ -1068,6 +1049,28 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1068
1049
return semver . coerce ( target ) ;
1069
1050
}
1070
1051
1052
+ private async mergeProjectPodFile ( projectData : IProjectData ) : Promise < void > {
1053
+ const platformData = this . getPlatformData ( projectData ) ;
1054
+ const { projectRoot, normalizedPlatformName } = platformData ;
1055
+ const mainPodfilePath = path . join ( projectData . appResourcesDirectoryPath , normalizedPlatformName , constants . PODFILE_NAME ) ;
1056
+ const projectPodfilePath = this . $cocoapodsService . getProjectPodfilePath ( projectRoot ) ;
1057
+ if ( this . $fs . exists ( projectPodfilePath ) || this . $fs . exists ( mainPodfilePath ) ) {
1058
+ const xcodeProjPath = this . getXcodeprojPath ( projectData ) ;
1059
+ const xcuserDataPath = path . join ( xcodeProjPath , "xcuserdata" ) ;
1060
+ const sharedDataPath = path . join ( xcodeProjPath , "xcshareddata" ) ;
1061
+
1062
+ if ( ! this . $fs . exists ( xcuserDataPath ) && ! this . $fs . exists ( sharedDataPath ) ) {
1063
+ this . $logger . info ( "Creating project scheme..." ) ;
1064
+ await this . checkIfXcodeprojIsRequired ( ) ;
1065
+
1066
+ const createSchemeRubyScript = `ruby -e "require 'xcodeproj'; xcproj = Xcodeproj::Project.open('${ projectData . projectName } .xcodeproj'); xcproj.recreate_user_schemes; xcproj.save"` ;
1067
+ await this . $childProcess . exec ( createSchemeRubyScript , { cwd : projectRoot } ) ;
1068
+ }
1069
+
1070
+ await this . $cocoapodsService . applyPodfileToProject ( constants . NS_BASE_PODFILE , mainPodfilePath , projectData , projectRoot ) ;
1071
+ }
1072
+ }
1073
+
1071
1074
private getAllLibsForPluginWithFileExtension ( pluginData : IPluginData , fileExtension : string ) : string [ ] {
1072
1075
const filterCallback = ( fileName : string , pluginPlatformsFolderPath : string ) => path . extname ( fileName ) === fileExtension ;
1073
1076
return this . getAllNativeLibrariesForPlugin ( pluginData , IOSProjectService . IOS_PLATFORM_NAME , filterCallback ) ;
0 commit comments