@@ -329,11 +329,11 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
329329 return this . $fs . writeFile ( this . pbxProjPath , project . writeSync ( ) ) ;
330330 }
331331
332- public preparePluginNativeCode ( pluginData : IPluginData ) : IFuture < void > {
332+ public preparePluginNativeCode ( pluginData : IPluginData , opts ?: any ) : IFuture < void > {
333333 return ( ( ) => {
334334 let pluginPlatformsFolderPath = pluginData . pluginPlatformsFolderPath ( IOSProjectService . IOS_PLATFORM_NAME ) ;
335335 this . prepareFrameworks ( pluginPlatformsFolderPath , pluginData ) . wait ( ) ;
336- this . prepareCocoapods ( pluginPlatformsFolderPath ) . wait ( ) ;
336+ this . prepareCocoapods ( pluginPlatformsFolderPath , opts ) . wait ( ) ;
337337 } ) . future < void > ( ) ( ) ;
338338 }
339339
@@ -372,8 +372,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
372372 this . $childProcess . exec ( createSchemeRubyScript , { cwd : this . platformData . projectRoot } ) . wait ( ) ;
373373 }
374374
375- this . $logger . info ( "Installing pods..." ) ;
376- this . $childProcess . exec ( "pod install" , { cwd : this . platformData . projectRoot } ) . wait ( ) ;
375+ this . executePodInstall ( ) . wait ( ) ;
377376 }
378377 } ) . future < void > ( ) ( ) ;
379378 }
@@ -418,23 +417,33 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
418417 } ) . future < void > ( ) ( ) ;
419418 }
420419
420+ private executePodInstall ( ) : IFuture < any > {
421+ this . $logger . info ( "Installing pods..." ) ;
422+ return this . $childProcess . exec ( "pod install" , { cwd : this . platformData . projectRoot } ) ;
423+ }
424+
421425 private prepareFrameworks ( pluginPlatformsFolderPath : string , pluginData : IPluginData ) : IFuture < void > {
422426 return ( ( ) => {
423427 _ . each ( this . getAllFrameworksForPlugin ( pluginData ) . wait ( ) , fileName => this . addLibrary ( path . join ( pluginPlatformsFolderPath , fileName ) ) . wait ( ) ) ;
424428 } ) . future < void > ( ) ( ) ;
425429 }
426430
427- private prepareCocoapods ( pluginPlatformsFolderPath : string ) : IFuture < void > {
431+ private prepareCocoapods ( pluginPlatformsFolderPath : string , opts ?: any ) : IFuture < void > {
428432 return ( ( ) => {
429- if ( ! this . $fs . exists ( this . projectPodFilePath ) . wait ( ) ) {
430- this . $fs . writeFile ( this . projectPodFilePath , "use_frameworks!\n" ) . wait ( ) ;
431- }
432433 let pluginPodFilePath = path . join ( pluginPlatformsFolderPath , "Podfile" ) ;
433434 if ( this . $fs . exists ( pluginPodFilePath ) . wait ( ) ) {
435+ if ( ! this . $fs . exists ( this . projectPodFilePath ) . wait ( ) ) {
436+ this . $fs . writeFile ( this . projectPodFilePath , "use_frameworks!\n" ) . wait ( ) ;
437+ }
438+
434439 let pluginPodFileContent = this . $fs . readText ( pluginPodFilePath ) . wait ( ) ;
435440 let contentToWrite = this . buildPodfileContent ( pluginPodFilePath , pluginPodFileContent ) ;
436441 this . $fs . appendFile ( this . projectPodFilePath , contentToWrite ) . wait ( ) ;
437442 }
443+
444+ if ( opts && opts . executePodInstall && this . $fs . exists ( pluginPodFilePath ) . wait ( ) ) {
445+ this . executePodInstall ( ) . wait ( ) ;
446+ }
438447 } ) . future < void > ( ) ( ) ;
439448 }
440449
0 commit comments