From 301234ced27b57b46ee94703d0f3666c4b021023 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Fri, 25 Mar 2022 05:09:20 -0700 Subject: [PATCH] Enable SonarKit and Flipper in React-Core Summary: 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 ## Changelog [iOS][Changed] - Enable SonarKit in React-Core when the configuration is `'Debug'` Differential Revision: D35141506 fbshipit-source-id: 019bab85d60b2b02ac50fcc82de7879833653505 --- 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 70e944d8e679..3068e67157d8 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -191,6 +191,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