Skip to content

Commit

Permalink
Hermes: Use pre-built Hermes runtime in iOS Template tests
Browse files Browse the repository at this point in the history
Differential Revision: D36989241

fbshipit-source-id: 5841a44d66e0461b53357fa9e645d4cc66303ad8
  • Loading branch information
hramos authored and facebook-github-bot committed Jun 8, 2022
1 parent cbf204c commit eb09611
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,16 @@ jobs:
- run_yarn
- attach_workspace:
at: .

- *attach_hermes_workspace
- run:
name: Set USE_HERMES=1
command: echo "export USE_HERMES=1" >> $BASH_ENV
- run:
name: Set HERMES_ENGINE_TARBALL_PATH
command: echo "export HERMES_ENGINE_TARBALL_PATH=$HERMES_WS_DIR/hermes-runtime-darwin/hermes-runtime-darwin-$CIRCLE_TAG.tar.gz" >> $BASH_ENV
- run:
name: Set RCT_VERBOSE_POD_INSTALL=1
command: echo "export RCT_VERBOSE_POD_INSTALL=1" >> $BASH_ENV
- run:
name: Create iOS template project
command: |
Expand Down Expand Up @@ -992,6 +1001,9 @@ jobs:
cp LICENSE /tmp/cocoapods-package-root
tar -C /tmp/cocoapods-package-root/ -czvf /tmp/hermes/output/hermes-runtime-darwin-v$(get_release_version).tar.gz .
mkdir -p /tmp/hermes/hermes-runtime-darwin
cp /tmp/hermes/output/hermes-runtime-darwin-v$(get_release_version).tar.gz /tmp/hermes/hermes-runtime-darwin/.
- save_cache:
key: *hermes_cache_key
paths:
Expand All @@ -1002,12 +1014,13 @@ jobs:
- ~/react-native/hermes/build_macosx
- ~/react-native/hermes/destroot
- store_artifacts:
path: /tmp/hermes/output/
path: /tmp/hermes/hermes-runtime-darwin/
- store_artifacts:
path: /tmp/hermes/osx-bin/
- persist_to_workspace:
root: /tmp/hermes/
paths:
- hermes-runtime-darwin
- osx-bin

build_hermesc_windows:
Expand Down
12 changes: 12 additions & 0 deletions scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def use_react_native! (options={})
pod 'RCT-Folly', :podspec => "#{prefix}/third-party-podspecs/RCT-Folly.podspec", :modular_headers => true

if new_arch_enabled
puts_verbose("Using New Architecture.")
app_path = options[:app_path]
config_file_dir = options[:config_file_dir]
use_react_native_codegen_discovery!({
Expand All @@ -101,11 +102,13 @@ def use_react_native! (options={})
pod 'React-Codegen', :path => $CODEGEN_OUTPUT_DIR, :modular_headers => true

if fabric_enabled
puts_verbose("Fabric is enabled.")
checkAndGenerateEmptyThirdPartyProvider!(prefix, new_arch_enabled, $CODEGEN_OUTPUT_DIR)
setup_fabric!(prefix)
end

if hermes_enabled
puts_verbose("Hermes is enabled.")
prepare_hermes = 'node scripts/hermes/prepare-hermes-for-build'
react_native_dir = Pod::Config.instance.installation_root.join(prefix)
prep_output, prep_status = Open3.capture2e(prepare_hermes, :chdir => react_native_dir)
Expand All @@ -122,6 +125,7 @@ def use_react_native! (options={})
# Flipper doesn't currently compile for release https://github.com/facebook/react-native/issues/33764
# Setting the production flag to true when build for production make sure that we don't install Flipper in the app in the first place.
if flipper_configuration.flipper_enabled && !production
puts_verbose("Flipper is enabled.")
install_flipper_dependencies(prefix)
use_flipper_pods(flipper_configuration.versions, :configurations => flipper_configuration.configurations)
end
Expand All @@ -148,6 +152,10 @@ def get_default_flags()
flags[:hermes_enabled] = true
end

if ENV['USE_HERMES'] == '1'
flags[:hermes_enabled] = true
end

return flags
end

Expand Down Expand Up @@ -654,3 +662,7 @@ def detect_changes_with_podfile(podfile)
changes
end
end

def puts_verbose(msg)
Pod::UI.puts(msg) if ENV['RCT_VERBOSE_POD_INSTALL']
end

0 comments on commit eb09611

Please sign in to comment.