@@ -357,43 +357,10 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
357
357
return Future . fromResult ( ) ;
358
358
}
359
359
360
- private getDeploymentTarget ( project : xcode . project ) : string {
361
- let configurations = project . pbxXCBuildConfigurationSection ( ) ;
362
-
363
- for ( let configName in configurations ) {
364
- if ( ! Object . prototype . hasOwnProperty . call ( configurations , configName ) ) {
365
- continue ;
366
- }
367
-
368
- let configuration = configurations [ configName ] ;
369
- if ( typeof configuration !== "object" ) {
370
- continue ;
371
- }
372
-
373
- let buildSettings = configuration . buildSettings ;
374
- if ( buildSettings [ "IPHONEOS_DEPLOYMENT_TARGET" ] ) {
375
- return buildSettings [ "IPHONEOS_DEPLOYMENT_TARGET" ] ;
376
- }
377
- }
378
- }
379
-
380
- private ensureIos8DeploymentTarget ( project : xcode . project ) {
381
- // [email protected] + has a default deployment target of 8.0 so this is not needed there
382
- if ( this . getDeploymentTarget ( project ) === "7.0" ) {
383
- project . updateBuildProperty ( "IPHONEOS_DEPLOYMENT_TARGET" , "8.0" ) ;
384
- this . $logger . info ( "The iOS Deployment Target is now 8.0 in order to support Cocoa Touch Frameworks." ) ;
385
- }
386
- }
387
-
388
- private addDynamicFramework ( frameworkPath : string ) : IFuture < void > {
360
+ private addFramework ( frameworkPath : string ) : IFuture < void > {
389
361
return ( ( ) => {
390
362
this . validateFramework ( frameworkPath ) . wait ( ) ;
391
363
392
- let targetPath = path . join ( "lib" , this . platformData . normalizedPlatformName ) ;
393
- let fullTargetPath = path . join ( this . $projectData . projectDir , targetPath ) ;
394
- this . $fs . ensureDirectoryExists ( fullTargetPath ) . wait ( ) ;
395
- shell . cp ( "-R" , frameworkPath , fullTargetPath ) ;
396
-
397
364
let project = this . createPbxProj ( ) ;
398
365
let frameworkName = path . basename ( frameworkPath , path . extname ( frameworkPath ) ) ;
399
366
let frameworkBinaryPath = path . join ( frameworkPath , frameworkName ) ;
@@ -403,10 +370,9 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
403
370
404
371
if ( isDynamic ) {
405
372
frameworkAddOptions [ "embed" ] = true ;
406
- this . ensureIos8DeploymentTarget ( project ) ;
407
373
}
408
374
409
- let frameworkRelativePath = this . getLibSubpathRelativeToProjectPath ( path . basename ( frameworkPath ) ) ;
375
+ let frameworkRelativePath = '$(SRCROOT)/' + this . getLibSubpathRelativeToProjectPath ( frameworkPath ) ;
410
376
project . addFramework ( frameworkRelativePath , frameworkAddOptions ) ;
411
377
this . savePbxProj ( project ) . wait ( ) ;
412
378
} ) . future < void > ( ) ( ) ;
@@ -417,21 +383,17 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
417
383
this . validateStaticLibrary ( staticLibPath ) . wait ( ) ;
418
384
// Copy files to lib folder.
419
385
let libraryName = path . basename ( staticLibPath , ".a" ) ;
420
- let libDestinationPath = path . join ( this . $projectData . projectDir , path . join ( "lib" , this . platformData . normalizedPlatformName ) ) ;
421
- let headersSubpath = path . join ( "include" , libraryName ) ;
422
- this . $fs . ensureDirectoryExists ( path . join ( libDestinationPath , headersSubpath ) ) . wait ( ) ;
423
- shell . cp ( "-Rf" , staticLibPath , libDestinationPath ) ;
424
- shell . cp ( "-Rf" , path . join ( path . dirname ( staticLibPath ) , headersSubpath ) , path . join ( libDestinationPath , "include" ) ) ;
386
+ let headersSubpath = path . join ( path . dirname ( staticLibPath ) , "include" , libraryName ) ;
425
387
426
388
// Add static library to project file and setup header search paths
427
389
let project = this . createPbxProj ( ) ;
428
- let relativeStaticLibPath = this . getLibSubpathRelativeToProjectPath ( path . basename ( staticLibPath ) ) ;
390
+ let relativeStaticLibPath = this . getLibSubpathRelativeToProjectPath ( staticLibPath ) ;
429
391
project . addFramework ( relativeStaticLibPath ) ;
430
392
431
393
let relativeHeaderSearchPath = path . join ( this . getLibSubpathRelativeToProjectPath ( headersSubpath ) ) ;
432
394
project . addToHeaderSearchPaths ( { relativePath : relativeHeaderSearchPath } ) ;
433
395
434
- this . generateMobulemap ( path . join ( libDestinationPath , headersSubpath ) , libraryName ) ;
396
+ this . generateModulemap ( headersSubpath , libraryName ) ;
435
397
this . savePbxProj ( project ) . wait ( ) ;
436
398
} ) . future < void > ( ) ( ) ;
437
399
}
@@ -711,9 +673,8 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
711
673
return name . replace ( / \\ \" / g, "\"" ) ;
712
674
}
713
675
714
- private getLibSubpathRelativeToProjectPath ( subPath : string ) : string {
715
- let targetPath = path . join ( "lib" , this . platformData . normalizedPlatformName ) ;
716
- let frameworkPath = path . relative ( "platforms/ios" , path . join ( targetPath , subPath ) ) ;
676
+ private getLibSubpathRelativeToProjectPath ( targetPath : string ) : string {
677
+ let frameworkPath = path . relative ( "platforms/ios" , targetPath ) ;
717
678
return frameworkPath ;
718
679
}
719
680
@@ -883,7 +844,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
883
844
884
845
private prepareFrameworks ( pluginPlatformsFolderPath : string , pluginData : IPluginData ) : IFuture < void > {
885
846
return ( ( ) => {
886
- _ . each ( this . getAllLibsForPluginWithFileExtension ( pluginData , ".framework" ) . wait ( ) , fileName => this . addDynamicFramework ( path . join ( pluginPlatformsFolderPath , fileName ) ) . wait ( ) ) ;
847
+ _ . each ( this . getAllLibsForPluginWithFileExtension ( pluginData , ".framework" ) . wait ( ) , fileName => this . addFramework ( path . join ( pluginPlatformsFolderPath , fileName ) ) . wait ( ) ) ;
887
848
} ) . future < void > ( ) ( ) ;
888
849
}
889
850
@@ -917,7 +878,6 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
917
878
this . $fs . writeFile ( this . projectPodFilePath , contentToWrite ) . wait ( ) ;
918
879
919
880
let project = this . createPbxProj ( ) ;
920
- this . ensureIos8DeploymentTarget ( project ) ;
921
881
this . savePbxProj ( project ) . wait ( ) ;
922
882
}
923
883
}
@@ -980,7 +940,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
980
940
return `# Begin Podfile - ${ pluginPodFilePath } ${ os . EOL } ${ pluginPodFileContent } ${ os . EOL } # End Podfile ${ os . EOL } ` ;
981
941
}
982
942
983
- private generateMobulemap ( headersFolderPath : string , libraryName : string ) : void {
943
+ private generateModulemap ( headersFolderPath : string , libraryName : string ) : void {
984
944
let headersFilter = ( fileName : string , containingFolderPath : string ) => ( path . extname ( fileName ) === ".h" && this . $fs . getFsStats ( path . join ( containingFolderPath , fileName ) ) . wait ( ) . isFile ( ) ) ;
985
945
let headersFolderContents = this . $fs . readDirectory ( headersFolderPath ) . wait ( ) ;
986
946
let headers = _ ( headersFolderContents ) . filter ( item => headersFilter ( item , headersFolderPath ) ) . value ( ) ;
0 commit comments