Skip to content

Commit d3fd9ed

Browse files
committed
chore: option to use bundle for cocoapod
1 parent 8acf3b0 commit d3fd9ed

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

lib/definitions/project.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ interface INsConfigPlaform {
104104
interface INsConfigIOS extends INsConfigPlaform {
105105
discardUncaughtJsExceptions?: boolean;
106106
runtimePackageName?: string
107+
cocoapodUseBundleExec?: boolean
107108
}
108109

109110
interface INSConfigVisionOS extends INsConfigIOS {}

lib/services/cocoapods-service.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export class CocoaPodsService implements ICocoaPodsService {
3535
private $logger: ILogger,
3636
private $config: IConfiguration,
3737
private $xcconfigService: IXcconfigService,
38-
private $xcodeSelectService: XcodeSelectService
38+
private $xcodeSelectService: XcodeSelectService,
39+
private $projectData: IProjectData,
3940
) {
4041
this.getCocoaPodsFromPodfile = _.memoize(
4142
this._getCocoaPodsFromPodfile,
@@ -59,8 +60,12 @@ export class CocoaPodsService implements ICocoaPodsService {
5960
projectRoot: string,
6061
xcodeProjPath: string
6162
): Promise<ISpawnResult> {
62-
this.$logger.info("Installing pods...");
63+
const cocoapodUseBundleExec = this.$projectData.nsConfig.ios?.cocoapodUseBundleExec;
6364
let podTool = this.$config.USE_POD_SANDBOX ? "sandbox-pod" : "pod";
65+
if (cocoapodUseBundleExec === true) {
66+
podTool = `bundle exec ${podTool}`
67+
}
68+
this.$logger.info(`Installing pods using "${podTool}"...`);
6469
const args = ["install"];
6570

6671
if (process.platform === "darwin" && process.arch === "arm64") {
@@ -71,7 +76,7 @@ export class CocoaPodsService implements ICocoaPodsService {
7176
// arch: posix_spawnp: pod: Bad CPU type in executable
7277
// in which case, we should run it natively.
7378
const res: string = await this.$childProcess
74-
.exec("arch -x86_64 pod --version", null, {
79+
.exec(`arch -x86_64 ${podTool} --version`, null, {
7580
showStderr: true,
7681
})
7782
.then((res) => res.stdout + " " + res.stderr)

0 commit comments

Comments
 (0)