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)