Skip to content

Commit

Permalink
fix: only include EXCLUDED_ARCHS workaround in xcode 12 (#5705)
Browse files Browse the repository at this point in the history
  • Loading branch information
rigor789 committed Nov 29, 2022
1 parent 7a312a2 commit 3e430cf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/services/cocoapods-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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,
Expand Down Expand Up @@ -164,6 +166,13 @@ ${versionResolutionHint}`);
projectData: IProjectData,
platformData: IPlatformData
): Promise<void> {
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");

Expand All @@ -179,7 +188,6 @@ post_install do |installer|
end`.trim();
this.$fs.writeFile(exclusionsPodfile, exclusions);
}

await this.applyPodfileToProject(
"NativeScript-CLI-Architecture-Exclusions",
exclusionsPodfile,
Expand Down

0 comments on commit 3e430cf

Please sign in to comment.