From 0d90a44adfb1892061d932353a23edc2fee9d7bc Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Mon, 7 Nov 2022 01:06:38 -0800 Subject: [PATCH] Remove hermesc build dir for non-Hermes build Summary: Changelog: [iOS][Fixed] - Remove hermesc build dir for non-Hermes build. Reviewed By: christophpurrer Differential Revision: D41052884 fbshipit-source-id: c9e85ca06cef79fa35e81972181558d44ca93d90 --- scripts/cocoapods/jsengine.rb | 15 +++++++-------- scripts/react_native_pods.rb | 1 + 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/cocoapods/jsengine.rb b/scripts/cocoapods/jsengine.rb index 73030a8062a..9c82e1d8618 100644 --- a/scripts/cocoapods/jsengine.rb +++ b/scripts/cocoapods/jsengine.rb @@ -64,14 +64,13 @@ def remove_hermesc_build_dir(react_native_path) %x(rm -rf #{react_native_path}/sdks/hermes-engine/build_host_hermesc) end -def is_building_hermes_from_source(react_native_version) - is_nightly = react_native_version.start_with?('0.0.0-') - has_tarball = ENV['HERMES_ENGINE_TARBALL_PATH'] != nil +def is_building_hermes_from_source(react_native_version, react_native_path) + isInMain = react_native_version.include?('1000.0.0') - # this is the same logic in the hermes-engine.podspec - if has_tarball || is_nightly - return false - end + hermestag_file = File.join(react_native_path, "sdks", ".hermesversion") + isInCI = ENV['CI'] === 'true' - return true + isReleaseBranch = File.exists?(hermestag_file) && isInCI + + return isInMain || isReleaseBranch end diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index d3e69f75511..910213464d0 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -209,6 +209,7 @@ def react_native_post_install(installer, react_native_path = "../node_modules/re add_copy_hermes_framework_script_phase(installer, react_native_path) else remove_copy_hermes_framework_script_phase(installer, react_native_path) + remove_hermesc_build_dir(react_native_path) end ReactNativePodsUtils.exclude_i386_architecture_while_using_hermes(installer)