@@ -360,6 +360,34 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
360
360
return Future . fromResult ( ) ;
361
361
}
362
362
363
+ private getDeploymentTarget ( project : xcode . project ) : string {
364
+ let configurations = project . pbxXCBuildConfigurationSection ( ) ;
365
+
366
+ for ( let configName in configurations ) {
367
+ if ( ! Object . prototype . hasOwnProperty . call ( configurations , configName ) ) {
368
+ continue ;
369
+ }
370
+
371
+ let configuration = configurations [ configName ] ;
372
+ if ( typeof configuration !== "object" ) {
373
+ continue ;
374
+ }
375
+
376
+ let buildSettings = configuration . buildSettings ;
377
+ if ( buildSettings [ "IPHONEOS_DEPLOYMENT_TARGET" ] ) {
378
+ return buildSettings [ "IPHONEOS_DEPLOYMENT_TARGET" ] ;
379
+ }
380
+ }
381
+ }
382
+
383
+ private ensureIos8DeploymentTarget ( project : xcode . project ) {
384
+ // [email protected] + has a default deployment target of 8.0 so this is not needed there
385
+ if ( this . getDeploymentTarget ( project ) === "7.0" ) {
386
+ project . updateBuildProperty ( "IPHONEOS_DEPLOYMENT_TARGET" , "8.0" ) ;
387
+ this . $logger . info ( "The iOS Deployment Target is now 8.0 in order to support Cocoa Touch Frameworks." ) ;
388
+ }
389
+ }
390
+
363
391
private addDynamicFramework ( frameworkPath : string ) : IFuture < void > {
364
392
return ( ( ) => {
365
393
this . validateFramework ( frameworkPath ) . wait ( ) ;
@@ -378,8 +406,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
378
406
379
407
if ( isDynamic ) {
380
408
frameworkAddOptions [ "embed" ] = true ;
381
- project . updateBuildProperty ( "IPHONEOS_DEPLOYMENT_TARGET" , "8.0" ) ;
382
- this . $logger . info ( "The iOS Deployment Target is now 8.0 in order to support Cocoa Touch Frameworks." ) ;
409
+ this . ensureIos8DeploymentTarget ( project ) ;
383
410
}
384
411
385
412
let frameworkRelativePath = this . getLibSubpathRelativeToProjectPath ( path . basename ( frameworkPath ) ) ;
@@ -906,8 +933,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
906
933
this . $fs . writeFile ( this . projectPodFilePath , contentToWrite ) . wait ( ) ;
907
934
908
935
let project = this . createPbxProj ( ) ;
909
- project . updateBuildProperty ( "IPHONEOS_DEPLOYMENT_TARGET" , "8.0" ) ;
910
- this . $logger . info ( "The iOS Deployment Target is now 8.0 in order to support Cocoa Touch Frameworks in CocoaPods." ) ;
936
+ this . ensureIos8DeploymentTarget ( project ) ;
911
937
this . savePbxProj ( project ) . wait ( ) ;
912
938
}
913
939
}
0 commit comments