@@ -50,7 +50,6 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
50
50
private $iOSEntitlementsService : IOSEntitlementsService ,
51
51
private $platformEnvironmentRequirements : IPlatformEnvironmentRequirements ,
52
52
private $plistParser : IPlistParser ,
53
- private $sysInfo : ISysInfo ,
54
53
private $xcconfigService : IXcconfigService ,
55
54
private $iOSExtensionsService : IIOSExtensionsService ) {
56
55
super ( $fs , $projectDataService ) ;
@@ -110,25 +109,17 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
110
109
if ( provision === true ) {
111
110
await this . $iOSProvisionService . listProvisions ( projectId ) ;
112
111
this . $errors . failWithoutHelp ( "Please provide provisioning profile uuid or name with the --provision option." ) ;
113
- return false ;
114
112
}
115
113
116
114
if ( teamId === true ) {
117
115
await this . $iOSProvisionService . listTeams ( ) ;
118
116
this . $errors . failWithoutHelp ( "Please provide team id or team name with the --teamId options." ) ;
119
- return false ;
120
117
}
121
118
122
119
return true ;
123
120
}
124
121
125
122
public getAppResourcesDestinationDirectoryPath ( projectData : IProjectData ) : string {
126
- const frameworkVersion = this . getFrameworkVersion ( projectData ) ;
127
-
128
- if ( semver . lt ( frameworkVersion , "1.3.0" ) ) {
129
- return path . join ( this . getPlatformData ( projectData ) . projectRoot , projectData . projectName , "Resources" , "icons" ) ;
130
- }
131
-
132
123
return path . join ( this . getPlatformData ( projectData ) . projectRoot , projectData . projectName , "Resources" ) ;
133
124
}
134
125
@@ -342,12 +333,6 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
342
333
'SHARED_PRECOMPS_DIR=' + path . join ( projectRoot , 'build' , 'sharedpch' )
343
334
] ;
344
335
345
- // Starting from tns-ios 1.4 the xcconfig file is referenced in the project template
346
- const frameworkVersion = this . getFrameworkVersion ( projectData ) ;
347
- if ( semver . lt ( frameworkVersion , "1.4.0" ) ) {
348
- basicArgs . push ( "-xcconfig" , path . join ( projectRoot , projectData . projectName , BUILD_XCCONFIG_FILE_NAME ) ) ;
349
- }
350
-
351
336
const handler = ( data : any ) => {
352
337
this . emit ( constants . BUILD_OUTPUT_EVENT_NAME , data ) ;
353
338
} ;
@@ -367,17 +352,6 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
367
352
this . validateApplicationIdentifier ( projectData ) ;
368
353
}
369
354
370
- public async validatePlugins ( projectData : IProjectData ) : Promise < void > {
371
- const installedPlugins = await ( < IPluginsService > this . $injector . resolve ( "pluginsService" ) ) . getAllInstalledPlugins ( projectData ) ;
372
- for ( const pluginData of installedPlugins ) {
373
- const pluginsFolderExists = this . $fs . exists ( path . join ( pluginData . pluginPlatformsFolderPath ( this . $devicePlatformsConstants . iOS . toLowerCase ( ) ) , "Podfile" ) ) ;
374
- const cocoaPodVersion = await this . $sysInfo . getCocoaPodsVersion ( ) ;
375
- if ( pluginsFolderExists && ! cocoaPodVersion ) {
376
- this . $errors . failWithoutHelp ( `${ pluginData . name } has Podfile and you don't have Cocoapods installed or it is not configured correctly. Please verify Cocoapods can work on your machine.` ) ;
377
- }
378
- }
379
- }
380
-
381
355
private async buildForDevice ( projectRoot : string , args : string [ ] , buildConfig : IBuildConfig , projectData : IProjectData ) : Promise < void > {
382
356
if ( ! buildConfig . release && ! buildConfig . architectures ) {
383
357
await this . $devicesService . initialize ( {
@@ -406,24 +380,15 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
406
380
"BUILD_DIR=" + path . join ( projectRoot , constants . BUILD_DIR )
407
381
] ) ;
408
382
409
- const xcodeBuildVersion = await this . getXcodeVersion ( ) ;
410
- if ( helpers . versionCompare ( xcodeBuildVersion , "8.0" ) >= 0 ) {
411
- await this . setupSigningForDevice ( projectRoot , buildConfig , projectData ) ;
412
- }
383
+ await this . setupSigningForDevice ( projectRoot , buildConfig , projectData ) ;
413
384
414
385
await this . createIpa ( projectRoot , projectData , buildConfig , args ) ;
415
386
}
416
387
417
388
private async xcodebuild ( args : string [ ] , cwd : string , stdio : any = "inherit" ) : Promise < ISpawnResult > {
418
389
const localArgs = [ ...args ] ;
419
- const xcodeBuildVersion = await this . getXcodeVersion ( ) ;
420
- try {
421
- if ( helpers . versionCompare ( xcodeBuildVersion , "9.0" ) >= 0 ) {
422
- localArgs . push ( "-allowProvisioningUpdates" ) ;
423
- }
424
- } catch ( e ) {
425
- this . $logger . warn ( "Failed to detect whether -allowProvisioningUpdates can be used with your xcodebuild version due to error: " + e ) ;
426
- }
390
+ localArgs . push ( "-allowProvisioningUpdates" ) ;
391
+
427
392
if ( this . $logger . getLevel ( ) === "INFO" ) {
428
393
localArgs . push ( "-quiet" ) ;
429
394
this . $logger . info ( "Xcode build..." ) ;
@@ -650,87 +615,6 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
650
615
return contentIsTheSame ;
651
616
}
652
617
653
- /**
654
- * Patch **LaunchScreen.xib** so we can be backward compatible for eternity.
655
- * The **xcodeproj** template proior v**2.1.0** had blank white screen launch screen.
656
- * We extended that by adding **app/AppResources/iOS/LaunchScreen.storyboard**
657
- * However for projects created prior **2.1.0** to keep working without the obsolete **LaunchScreen.xib**
658
- * we must still provide it on prepare.
659
- * Here we check if **UILaunchStoryboardName** is set to **LaunchScreen** in the **platform/ios/<proj>/<proj>-Info.plist**.
660
- * If it is, and no **LaunchScreen.storyboard** nor **.xib** is found in the project, we will create one.
661
- */
662
- private provideLaunchScreenIfMissing ( projectData : IProjectData ) : void {
663
- try {
664
- this . $logger . trace ( "Checking if we need to provide compatability LaunchScreen.xib" ) ;
665
- const platformData = this . getPlatformData ( projectData ) ;
666
- const projectPath = path . join ( platformData . projectRoot , projectData . projectName ) ;
667
- const projectPlist = this . getInfoPlistPath ( projectData ) ;
668
- const plistContent = plist . parse ( this . $fs . readText ( projectPlist ) ) ;
669
- const storyName = plistContent [ "UILaunchStoryboardName" ] ;
670
- this . $logger . trace ( `Examining ${ projectPlist } UILaunchStoryboardName: "${ storyName } ".` ) ;
671
- if ( storyName !== "LaunchScreen" ) {
672
- this . $logger . trace ( "The project has its UILaunchStoryboardName set to " + storyName + " which is not the pre v2.1.0 default LaunchScreen, probably the project is migrated so we are good to go." ) ;
673
- return ;
674
- }
675
-
676
- const expectedStoryPath = path . join ( projectPath , "Resources" , "LaunchScreen.storyboard" ) ;
677
- if ( this . $fs . exists ( expectedStoryPath ) ) {
678
- // Found a LaunchScreen on expected path
679
- this . $logger . trace ( "LaunchScreen.storyboard was found. Project is up to date." ) ;
680
- return ;
681
- }
682
- this . $logger . trace ( "LaunchScreen file not found at: " + expectedStoryPath ) ;
683
-
684
- const expectedXibPath = path . join ( projectPath , "en.lproj" , "LaunchScreen.xib" ) ;
685
- if ( this . $fs . exists ( expectedXibPath ) ) {
686
- this . $logger . trace ( "Obsolete LaunchScreen.xib was found. It'k OK, we are probably running with iOS runtime from pre v2.1.0." ) ;
687
- return ;
688
- }
689
- this . $logger . trace ( "LaunchScreen file not found at: " + expectedXibPath ) ;
690
-
691
- const isTheLaunchScreenFile = ( fileName : string ) => fileName === "LaunchScreen.xib" || fileName === "LaunchScreen.storyboard" ;
692
- const matches = this . $fs . enumerateFilesInDirectorySync ( projectPath , isTheLaunchScreenFile , { enumerateDirectories : false } ) ;
693
- if ( matches . length > 0 ) {
694
- this . $logger . trace ( "Found LaunchScreen by slowly traversing all files here: " + matches + "\nConsider moving the LaunchScreen so it could be found at: " + expectedStoryPath ) ;
695
- return ;
696
- }
697
-
698
- const compatabilityXibPath = path . join ( projectPath , "Resources" , "LaunchScreen.xib" ) ;
699
- this . $logger . warn ( `Failed to find LaunchScreen.storyboard but it was specified in the Info.plist.
700
- Consider updating the resources in app/App_Resources/iOS/.
701
- A good starting point would be to create a new project and diff the changes with your current one.
702
- Also the following repo may be helpful: https://github.com/NativeScript/template-hello-world/tree/master/App_Resources/iOS
703
- We will now place an empty obsolete compatability white screen LauncScreen.xib for you in ${ path . relative ( projectData . projectDir , compatabilityXibPath ) } so your app may appear as it did in pre v2.1.0 versions of the ios runtime.` ) ;
704
-
705
- const content = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
706
- <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6751" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
707
- <dependencies>
708
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
709
- </dependencies>
710
- <objects>
711
- <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
712
- <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
713
- <view contentMode="scaleToFill" id="iN0-l3-epB">
714
- <rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
715
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
716
- <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
717
- <nil key="simulatedStatusBarMetrics"/>
718
- <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
719
- <point key="canvasLocation" x="548" y="455"/>
720
- </view>
721
- </objects>
722
- </document>` ;
723
- try {
724
- this . $fs . createDirectory ( path . dirname ( compatabilityXibPath ) ) ;
725
- this . $fs . writeFile ( compatabilityXibPath , content ) ;
726
- } catch ( e ) {
727
- this . $logger . warn ( "We have failed to add compatability LaunchScreen.xib due to: " + e ) ;
728
- }
729
- } catch ( e ) {
730
- this . $logger . warn ( "We have failed to check if we need to add a compatability LaunchScreen.xib due to: " + e ) ;
731
- }
732
- }
733
-
734
618
public async prepareProject ( projectData : IProjectData , platformSpecificData : IPlatformSpecificData ) : Promise < void > {
735
619
const projectRoot = path . join ( projectData . platformsDir , "ios" ) ;
736
620
@@ -745,8 +629,6 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
745
629
746
630
const project = this . createPbxProj ( projectData ) ;
747
631
748
- this . provideLaunchScreenIfMissing ( projectData ) ;
749
-
750
632
const resources = project . pbxGroupByName ( "Resources" ) ;
751
633
752
634
if ( resources ) {
@@ -801,14 +683,6 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
801
683
await this . mergeProjectXcconfigFiles ( projectData , opts ) ;
802
684
}
803
685
804
- private getInfoPlistPath ( projectData : IProjectData ) : string {
805
- return path . join (
806
- projectData . appResourcesDirectoryPath ,
807
- this . getPlatformData ( projectData ) . normalizedPlatformName ,
808
- this . getPlatformData ( projectData ) . configurationFileName
809
- ) ;
810
- }
811
-
812
686
public ensureConfigurationFileInAppResources ( ) : void {
813
687
return null ;
814
688
}
@@ -826,11 +700,6 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
826
700
const infoPlistPath = path . join ( projectData . appResourcesDirectoryPath , this . getPlatformData ( projectData ) . normalizedPlatformName , this . getPlatformData ( projectData ) . configurationFileName ) ;
827
701
this . ensureConfigurationFileInAppResources ( ) ;
828
702
829
- if ( ! this . $fs . exists ( infoPlistPath ) ) {
830
- this . $logger . trace ( "Info.plist: No app/App_Resources/iOS/Info.plist found, falling back to pre-1.6.0 Info.plist behavior." ) ;
831
- return ;
832
- }
833
-
834
703
const reporterTraceMessage = "Info.plist:" ;
835
704
const reporter : Reporter = {
836
705
log : ( txt : string ) => this . $logger . trace ( `${ reporterTraceMessage } ${ txt } ` ) ,
@@ -1244,21 +1113,6 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1244
1113
}
1245
1114
}
1246
1115
1247
- private async getXcodeVersion ( ) : Promise < string > {
1248
- let xcodeBuildVersion = "" ;
1249
-
1250
- try {
1251
- xcodeBuildVersion = await this . $sysInfo . getXcodeVersion ( ) ;
1252
- } catch ( error ) {
1253
- this . $errors . fail ( "xcodebuild execution failed. Make sure that you have latest Xcode and tools installed." ) ;
1254
- }
1255
-
1256
- const splitedXcodeBuildVersion = xcodeBuildVersion . split ( "." ) ;
1257
- xcodeBuildVersion = `${ splitedXcodeBuildVersion [ 0 ] || 0 } .${ splitedXcodeBuildVersion [ 1 ] || 0 } ` ;
1258
-
1259
- return xcodeBuildVersion ;
1260
- }
1261
-
1262
1116
private getBuildXCConfigFilePath ( projectData : IProjectData ) : string {
1263
1117
const buildXCConfig = path . join ( projectData . appResourcesDirectoryPath ,
1264
1118
this . getPlatformData ( projectData ) . normalizedPlatformName , BUILD_XCCONFIG_FILE_NAME ) ;
0 commit comments