From 0c5d0cca2bd5333071ecc97298534d1ba760f207 Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Tue, 29 Nov 2022 15:54:27 +0100 Subject: [PATCH 1/2] fix: remove EXCLUDED_ARCHS workaround in xcode 13+ --- lib/services/cocoapods-service.ts | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/services/cocoapods-service.ts b/lib/services/cocoapods-service.ts index ca4211961b..3927796309 100644 --- a/lib/services/cocoapods-service.ts +++ b/lib/services/cocoapods-service.ts @@ -20,6 +20,7 @@ import { ISpawnResult, } from "../common/declarations"; import { injector } from "../common/yok"; +import { XcodeSelectService } from "../common/services/xcode-select-service"; export class CocoaPodsService implements ICocoaPodsService { private static PODFILE_POST_INSTALL_SECTION_NAME = "post_install"; @@ -32,7 +33,8 @@ export class CocoaPodsService implements ICocoaPodsService { private $errors: IErrors, private $logger: ILogger, private $config: IConfiguration, - private $xcconfigService: IXcconfigService + private $xcconfigService: IXcconfigService, + private $xcodeSelectService: XcodeSelectService ) { this.getCocoaPodsFromPodfile = _.memoize( this._getCocoaPodsFromPodfile, @@ -179,13 +181,17 @@ post_install do |installer| end`.trim(); this.$fs.writeFile(exclusionsPodfile, exclusions); } - - await this.applyPodfileToProject( - "NativeScript-CLI-Architecture-Exclusions", - exclusionsPodfile, - projectData, - platformData - ); + const xcodeVersionData = await this.$xcodeSelectService.getXcodeVersion(); + if (+xcodeVersionData.major < 13) { + // apply EXCLUDED_ARCHS workaround on XCode <13 + // XCode 13+ no longer requires the workaround + await this.applyPodfileToProject( + "NativeScript-CLI-Architecture-Exclusions", + exclusionsPodfile, + projectData, + platformData + ); + } // clean up this.$fs.deleteFile(exclusionsPodfile); From d6329361b094ea9e8efa7074ab124ff7a9de0754 Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Tue, 29 Nov 2022 15:58:47 +0100 Subject: [PATCH 2/2] refactor: only apply on XCode 12 --- lib/services/cocoapods-service.ts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/services/cocoapods-service.ts b/lib/services/cocoapods-service.ts index 3927796309..6c71c7cea8 100644 --- a/lib/services/cocoapods-service.ts +++ b/lib/services/cocoapods-service.ts @@ -166,6 +166,13 @@ ${versionResolutionHint}`); projectData: IProjectData, platformData: IPlatformData ): Promise { + const xcodeVersionData = await this.$xcodeSelectService.getXcodeVersion(); + + // only apply EXCLUDED_ARCHS workaround on XCode 12 + if (+xcodeVersionData.major !== 12) { + return; + } + const { projectRoot } = platformData; const exclusionsPodfile = path.join(projectRoot, "Podfile-exclusions"); @@ -181,17 +188,12 @@ post_install do |installer| end`.trim(); this.$fs.writeFile(exclusionsPodfile, exclusions); } - const xcodeVersionData = await this.$xcodeSelectService.getXcodeVersion(); - if (+xcodeVersionData.major < 13) { - // apply EXCLUDED_ARCHS workaround on XCode <13 - // XCode 13+ no longer requires the workaround - await this.applyPodfileToProject( - "NativeScript-CLI-Architecture-Exclusions", - exclusionsPodfile, - projectData, - platformData - ); - } + await this.applyPodfileToProject( + "NativeScript-CLI-Architecture-Exclusions", + exclusionsPodfile, + projectData, + platformData + ); // clean up this.$fs.deleteFile(exclusionsPodfile);