From b5343a6b0dd07c1b4ef9dac549df67a4d68ebd1e 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 70e944d8e67982..3068e67157d856 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