From 46b685ea92b36b5464b4b8903b0575db2edc64fa Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Fri, 25 Mar 2022 05:57:50 -0700 Subject: [PATCH] Enable SonarKit and Flipper in React-Core (#33499) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/33499 This DIFF turns on the `FB_SONARKIT_ENABLED` flag when installing Flipper ina RN app. The flag is enabled only in Debug config, given that Flipper is installed only in this configuration. This PR also fixes this issue: https://github.com/facebook/react-native/issues/33497 This PR is required because release 0.67 has the Flag in the app, while release 0.68 moved it in the React-Core pod. We can't enable the flag at the `React-Core.podspec` level because we should not make assumptions on whether users want flipper or not. ## Changelog [iOS][Changed] - Enable SonarKit in React-Core when the configuration is `'Debug'` Reviewed By: cortinico Differential Revision: D35141506 fbshipit-source-id: 171b7fa8ea7727c633ef963408e86b332c32e9fa --- scripts/react_native_pods.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index a8f3aa803e..23829b129a 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -179,6 +179,15 @@ def flipper_post_install(installer) config.build_settings['SWIFT_VERSION'] = '4.1' end end + + # Enable flipper for React-Core Debug configuration + if target.name == 'React-Core' + target.build_configurations.each do |config| + if config.name == 'Debug' + config.build_settings['OTHER_CFLAGS'] = "$(inherited) -DFB_SONARKIT_ENABLED=1" + end + end + end end end