From 443c1794b38d94686619bb9a89f162ed522fd74c Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 18 Oct 2023 05:48:41 -0700 Subject: [PATCH] Make hermes build fetching more flavour resilient Summary: 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 Differential Revision: D50408381 --- .../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 769d8ce0d60afc..c7e22ddf572225 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