@@ -110,7 +110,13 @@ function createTestInjector(
110
110
) ;
111
111
testInjector . register ( "projectData" , projectData ) ;
112
112
testInjector . register ( "projectHelper" , { } ) ;
113
- testInjector . register ( "xcodeSelectService" , { } ) ;
113
+ testInjector . register ( "xcodeSelectService" , {
114
+ getXcodeVersion ( ) {
115
+ return {
116
+ major : 14 ,
117
+ } ;
118
+ } ,
119
+ } ) ;
114
120
testInjector . register ( "staticConfig" , ConfigLib . StaticConfig ) ;
115
121
testInjector . register ( "projectDataService" , ProjectDataServiceStub ) ;
116
122
testInjector . register ( "prompter" , { } ) ;
@@ -259,24 +265,24 @@ describe("Cocoapods support", () => {
259
265
if ( require ( "os" ) . platform ( ) !== "darwin" ) {
260
266
console . log ( "Skipping Cocoapods tests. They cannot work on windows" ) ;
261
267
} else {
262
- const expectedArchExclusions = ( projectPath : string ) =>
263
- [
264
- `` ,
265
- `post_install do |installer|` ,
266
- ` post_installNativeScript_CLI_Architecture_Exclusions_0 installer` ,
267
- `end` ,
268
- `` ,
269
- `# Begin Podfile - ${ projectPath } /platforms/ios/Podfile-exclusions` ,
270
- `def post_installNativeScript_CLI_Architecture_Exclusions_0 (installer)` ,
271
- ` installer.pods_project.build_configurations.each do |config|` ,
272
- ` config.build_settings.delete "VALID_ARCHS"` ,
273
- ` config.build_settings["EXCLUDED_ARCHS_x86_64"] = "arm64 arm64e"` ,
274
- ` config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "i386 armv6 armv7 armv7s armv8 $(EXCLUDED_ARCHS_$(NATIVE_ARCH_64_BIT))"` ,
275
- ` config.build_settings["EXCLUDED_ARCHS[sdk=iphoneos*]"] = "i386 armv6 armv7 armv7s armv8 x86_64"` ,
276
- ` end` ,
277
- `end` ,
278
- `# End Podfile` ,
279
- ] . join ( "\n" ) ;
268
+ // const expectedArchExclusions = (projectPath: string) =>
269
+ // [
270
+ // ``,
271
+ // `post_install do |installer|`,
272
+ // ` post_installNativeScript_CLI_Architecture_Exclusions_0 installer`,
273
+ // `end`,
274
+ // ``,
275
+ // `# Begin Podfile - ${projectPath}/platforms/ios/Podfile-exclusions`,
276
+ // `def post_installNativeScript_CLI_Architecture_Exclusions_0 (installer)`,
277
+ // ` installer.pods_project.build_configurations.each do |config|`,
278
+ // ` config.build_settings.delete "VALID_ARCHS"`,
279
+ // ` config.build_settings["EXCLUDED_ARCHS_x86_64"] = "arm64 arm64e"`,
280
+ // ` config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "i386 armv6 armv7 armv7s armv8 $(EXCLUDED_ARCHS_$(NATIVE_ARCH_64_BIT))"`,
281
+ // ` config.build_settings["EXCLUDED_ARCHS[sdk=iphoneos*]"] = "i386 armv6 armv7 armv7s armv8 x86_64"`,
282
+ // ` end`,
283
+ // `end`,
284
+ // `# End Podfile`,
285
+ // ].join("\n");
280
286
281
287
it ( "adds а base Podfile" , async ( ) => {
282
288
const projectName = "projectDirectory" ;
@@ -486,7 +492,8 @@ describe("Cocoapods support", () => {
486
492
`# Begin Podfile - ${ pluginPodfilePath } ` ,
487
493
expectedPluginPodfileContent ,
488
494
"# End Podfile" ,
489
- expectedArchExclusions ( projectPath ) ,
495
+ // only on xcode 12
496
+ // expectedArchExclusions(projectPath),
490
497
"end" ,
491
498
] . join ( "\n" ) ;
492
499
assert . equal ( actualProjectPodfileContent , expectedProjectPodfileContent ) ;
@@ -613,7 +620,8 @@ describe("Cocoapods support", () => {
613
620
`# Begin Podfile - ${ pluginPodfilePath } ` ,
614
621
expectedPluginPodfileContent ,
615
622
"# End Podfile" ,
616
- expectedArchExclusions ( projectPath ) ,
623
+ // only on XCode 12
624
+ // expectedArchExclusions(projectPath),
617
625
"end" ,
618
626
] . join ( "\n" ) ;
619
627
assert . equal ( actualProjectPodfileContent , expectedProjectPodfileContent ) ;
@@ -623,18 +631,21 @@ describe("Cocoapods support", () => {
623
631
projectData
624
632
) ;
625
633
626
- const expectedProjectPodfileContentAfter = [
627
- "use_frameworks!\n" ,
628
- `target "${ projectName } " do` ,
629
- "" ,
630
- expectedArchExclusions ( projectPath ) ,
631
- "end" ,
632
- ] . join ( "\n" ) ;
633
- actualProjectPodfileContent = fs . readText ( projectPodfilePath ) ;
634
- assert . equal (
635
- actualProjectPodfileContent ,
636
- expectedProjectPodfileContentAfter
637
- ) ;
634
+ assert . isFalse ( fs . exists ( projectPodfilePath ) ) ;
635
+
636
+ // only on xcode12
637
+ // const expectedProjectPodfileContentAfter = [
638
+ // "use_frameworks!\n",
639
+ // `target "${projectName}" do`,
640
+ // "",
641
+ // expectedArchExclusions(projectPath),
642
+ // "end",
643
+ // ].join("\n");
644
+ // actualProjectPodfileContent = fs.readText(projectPodfilePath);
645
+ // assert.equal(
646
+ // actualProjectPodfileContent,
647
+ // expectedProjectPodfileContentAfter
648
+ // );
638
649
} ) ;
639
650
}
640
651
} ) ;
0 commit comments