@@ -262,13 +262,24 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
262
262
this . savePbxProj ( project ) . wait ( ) ;
263
263
}
264
264
265
+ if ( this . $fs . exists ( this . projectPodFilePath ) . wait ( ) && this . $fs . getFsStats ( this . projectPodFilePath ) . wait ( ) . mtime < this . $fs . getFsStats ( this . $projectData . projectFilePath ) . wait ( ) . mtime ) {
266
+ try {
267
+ this . $childProcess . exec ( "pod install" , { cwd : this . platformData . projectRoot } ) . wait ( ) ;
268
+ } catch ( e ) {
269
+ this . $errors . failWithoutHelp ( "CocoaPods are not installed. Run `sudo gem install cocoapods` and try again." ) ;
270
+ }
271
+ }
265
272
} ) . future < void > ( ) ( ) ;
266
273
}
267
274
268
275
public prepareAppResources ( appResourcesDirectoryPath : string ) : IFuture < void > {
269
276
return this . $fs . deleteDirectory ( this . platformData . appResourcesDestinationDirectoryPath ) ;
270
277
}
271
278
279
+ private get projectPodFilePath ( ) : string {
280
+ return path . join ( this . platformData . projectRoot , "Podfile" ) ;
281
+ }
282
+
272
283
private replace ( name : string ) : string {
273
284
if ( _ . startsWith ( name , '"' ) ) {
274
285
name = name . substr ( 1 , name . length - 2 ) ;
@@ -303,6 +314,12 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
303
314
return ( ( ) => {
304
315
let pluginPlatformsFolderPath = pluginData . pluginPlatformsFolderPath ( IOSProjectService . IOS_PLATFORM_NAME ) ;
305
316
_ . each ( this . getAllDynamicFrameworksForPlugin ( pluginData ) . wait ( ) , fileName => this . addLibrary ( path . join ( pluginPlatformsFolderPath , fileName ) ) . wait ( ) ) ;
317
+
318
+ let pluginPodFilePath = path . join ( pluginPlatformsFolderPath , "Podfile" ) ;
319
+ if ( this . $fs . exists ( pluginPodFilePath ) . wait ( ) ) {
320
+ let pluginPodFileContent = this . $fs . readText ( pluginPodFilePath ) . wait ( ) ;
321
+ this . $fs . appendFile ( this . projectPodFilePath , pluginPodFileContent ) . wait ( ) ;
322
+ }
306
323
} ) . future < void > ( ) ( ) ;
307
324
}
308
325
@@ -318,6 +335,14 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
318
335
} ) ;
319
336
320
337
this . savePbxProj ( project ) . wait ( ) ;
338
+
339
+ let pluginPodFilePath = path . join ( pluginPlatformsFolderPath , "Podfile" ) ;
340
+ if ( this . $fs . exists ( pluginPodFilePath ) . wait ( ) ) {
341
+ let pluginPodFileContent = this . $fs . readText ( pluginPodFilePath ) . wait ( ) ;
342
+ let projectPodFileContent = this . $fs . readText ( this . projectPodFilePath ) . wait ( ) ;
343
+ projectPodFileContent = helpers . stringReplaceAll ( projectPodFileContent , pluginPodFileContent , "" ) ;
344
+ this . $fs . writeFile ( this . projectPodFilePath , projectPodFileContent ) . wait ( ) ;
345
+ }
321
346
} ) . future < void > ( ) ( ) ;
322
347
}
323
348
0 commit comments