From 272a134654ab2bc0f268ac72f409be4f716bb6bc Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Mon, 1 May 2023 10:52:31 -0700 Subject: [PATCH] Make sure that hermes-engine is updated with cocoapods. (#37148) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37148 This should fix https://github.com/facebook/react-native/issue/36945, which is also causing annoyance when doing the releases ## Changelog: [iOS][Changed] - Use contents of sdks/.hermesversion to let cocoapods recognize Hermes updates. Differential Revision: D45394241 fbshipit-source-id: 3304a7fbcd6303bd22cd7f0c0ce6a3bc2c13cb65 --- packages/react-native/scripts/cocoapods/jsengine.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react-native/scripts/cocoapods/jsengine.rb b/packages/react-native/scripts/cocoapods/jsengine.rb index 25ed410bb4c9d3..e8d9349548840c 100644 --- a/packages/react-native/scripts/cocoapods/jsengine.rb +++ b/packages/react-native/scripts/cocoapods/jsengine.rb @@ -30,7 +30,11 @@ def setup_hermes!(react_native_path: "../node_modules/react-native", fabric_enab abort unless prep_status == 0 pod 'React-jsi', :path => "#{react_native_path}/ReactCommon/jsi" - pod 'hermes-engine', :podspec => "#{react_native_path}/sdks/hermes/hermes-engine.podspec" + # This `:tag => hermestag` below is only to tell CocoaPods to update hermes-engine when React Native version changes. + # We have custom logic to compute the source for hermes-engine. See sdks/hermes-engine/* + hermestag_file = File.join(react_native_path, "sdks", ".hermesversion") + hermestag = File.exist?(hermestag_file) ? File.read().strip : '' + pod 'hermes-engine', :podspec => "#{react_native_path}/sdks/hermes-engine/hermes-engine.podspec", :tag => hermestag pod 'React-hermes', :path => "#{react_native_path}/ReactCommon/hermes" pod 'libevent', '~> 2.1.12' end