From 0a8639ceb9df8fb30cf93eb700aa6cd0b45d8b9e Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 19 Oct 2023 02:38:52 -0700 Subject: [PATCH] Make hermes build fetching more flavour resilient (#41055) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41055 This should fix the issue highlighted in [this comment](https://github.com/reactwg/react-native-releases/discussions/64#discussioncomment-7271155). Basically, before the fix, we were not supporting flavours correctly, as we assumed that only Debug and Release were available. With this change, we infer whether we have to fetch Hermes for Debug or Release based on the actual flags that are passed. In this way, the users can customize their app's flavors more freely. ## Changelog: [Internal] - Support multiple flavors when downloading Hermes Reviewed By: huntie Differential Revision: D50408381 fbshipit-source-id: 6990218b286b4dd823323bc63de90279efc9e74e --- .../react-native/sdks/hermes-engine/hermes-engine.podspec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec index 769d8ce0d60..c7e22ddf572 100644 --- a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec +++ b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec @@ -60,7 +60,13 @@ Pod::Spec.new do |spec| :execution_position => :before_compile, :script => <<-EOS . "$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh" - "$NODE_BINARY" "$REACT_NATIVE_PATH/sdks/hermes-engine/utils/replace_hermes_version.js" -c "$CONFIGURATION" -r "#{version}" -p "$PODS_ROOT" + + CONFIG="Release" + if echo $GCC_PREPROCESSOR_DEFINITIONS | grep -q "DEBUG=1"; then + CONFIG="Debug" + fi + + "$NODE_BINARY" "$REACT_NATIVE_PATH/sdks/hermes-engine/utils/replace_hermes_version.js" -c "$CONFIG" -r "#{version}" -p "$PODS_ROOT" EOS } end