Skip to content

Commit 3e430cf

Browse files
authored
fix: only include EXCLUDED_ARCHS workaround in xcode 12 (#5705)
1 parent 7a312a2 commit 3e430cf

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/services/cocoapods-service.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
ISpawnResult,
2121
} from "../common/declarations";
2222
import { injector } from "../common/yok";
23+
import { XcodeSelectService } from "../common/services/xcode-select-service";
2324

2425
export class CocoaPodsService implements ICocoaPodsService {
2526
private static PODFILE_POST_INSTALL_SECTION_NAME = "post_install";
@@ -32,7 +33,8 @@ export class CocoaPodsService implements ICocoaPodsService {
3233
private $errors: IErrors,
3334
private $logger: ILogger,
3435
private $config: IConfiguration,
35-
private $xcconfigService: IXcconfigService
36+
private $xcconfigService: IXcconfigService,
37+
private $xcodeSelectService: XcodeSelectService
3638
) {
3739
this.getCocoaPodsFromPodfile = _.memoize(
3840
this._getCocoaPodsFromPodfile,
@@ -164,6 +166,13 @@ ${versionResolutionHint}`);
164166
projectData: IProjectData,
165167
platformData: IPlatformData
166168
): Promise<void> {
169+
const xcodeVersionData = await this.$xcodeSelectService.getXcodeVersion();
170+
171+
// only apply EXCLUDED_ARCHS workaround on XCode 12
172+
if (+xcodeVersionData.major !== 12) {
173+
return;
174+
}
175+
167176
const { projectRoot } = platformData;
168177
const exclusionsPodfile = path.join(projectRoot, "Podfile-exclusions");
169178

@@ -179,7 +188,6 @@ post_install do |installer|
179188
end`.trim();
180189
this.$fs.writeFile(exclusionsPodfile, exclusions);
181190
}
182-
183191
await this.applyPodfileToProject(
184192
"NativeScript-CLI-Architecture-Exclusions",
185193
exclusionsPodfile,

0 commit comments

Comments
 (0)