Skip to content

Commit

Permalink
Allow apple to configure Hermes as option (#44461)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #44461

Users would have to do this by manipulating the environment before.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57067036

fbshipit-source-id: 6df16c884412578c3b5cae50e26ca37636a7dc5b
  • Loading branch information
blakef authored and facebook-github-bot committed May 8, 2024
1 parent 8d0046a commit 01cbb17
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
15 changes: 10 additions & 5 deletions packages/core-cli-utils/src/private/apple.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type AppleBuildOptions = {

type AppleBootstrapOption = {
// Enabled by default
hermes: boolean,
newArchitecture: boolean,
...AppleOptions,
};
Expand Down Expand Up @@ -75,12 +76,16 @@ export const tasks = {
cwd: options.cwd,
}),
),
installDependencies: task(THIRD, 'Install CocoaPods dependencies', () =>
execa('bundle', ['exec', 'pod', 'install'], {
installDependencies: task(THIRD, 'Install CocoaPods dependencies', () => {
const env = {
RCT_NEW_ARCH_ENABLED: options.newArchitecture ? '1' : '0',
HERMES: options.hermes ? '1' : '0',
};
return execa('bundle', ['exec', 'pod', 'install'], {
cwd: options.cwd,
env: {RCT_NEW_ARCH_ENABLED: options.newArchitecture ? '1' : '0'},
}),
),
env,
});
}),
}),

// 2. Build the iOS app using a setup environment
Expand Down
6 changes: 4 additions & 2 deletions packages/helloworld/cli.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,14 @@ function run(
bootstrap
.command('ios')
.description('Bootstrap iOS')
.option('--hermes', 'Enable Hermes', true)
.option('--new-architecture', 'Enable new architecture', true)
.action(async (_, options: {newArchitecture: boolean}) => {
.action(async (_, options: {newArchitecture: boolean, hermes: boolean}) => {
await run(
apple.bootstrap({
newArchitecture: options.newArchitecture,
cwd: cwd.ios,
hermes: options.hermes,
newArchitecture: options.newArchitecture,
}),
);
});
Expand Down

0 comments on commit 01cbb17

Please sign in to comment.