react-native
react-native copied to clipboard
feat: set Swift active compilation conditions build setting to DEBUG
Summary:
This PR adds cocoapods utility to set SWIFT_ACTIVE_COMPILATION_CONDITIONS
to DEBUG, which is set to this value by default (when generating a new native Xcode project).
This allows to use the #if DEBUG
compilator directive in Swift to work out of the box, without any changes on user's side:
override func bundleURL() -> URL? {
#if DEBUG
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
}
Changelog:
[IOS] [ADDED] - Set SWIFT_ACTIVE_COMPILATION_CONDITIONS to DEBUG
Test Plan:
Run bundle exec pod install
and check if the active compilation flags are populated:
Platform | Engine | Arch | Size (bytes) | Diff |
---|---|---|---|---|
android | hermes | arm64-v8a | 16,803,066 | -435,494 |
android | hermes | armeabi-v7a | n/a | -- |
android | hermes | x86 | n/a | -- |
android | hermes | x86_64 | n/a | -- |
android | jsc | arm64-v8a | 20,190,312 | -410,683 |
android | jsc | armeabi-v7a | n/a | -- |
android | jsc | x86 | n/a | -- |
android | jsc | x86_64 | n/a | -- |
Base commit: b41a33ede99826aa6b100e5fb53b1a918a5b8bba Branch: main
Hey @cipolleschi, anything I can do to help you get this one merged?
@cipolleschi I've refactored the method to set_build_setting
which accepts necessary arguments to set proper build settings. This method can remove set_use_hermes_build_setting
and set_node_modules_user_settings
methods (less code to maintain). I've also changed the tests to only test the utility
/rebase - this command rebase the pr on top of main automatically
Hey @cipolleschi, is there anything more we need to get done in order to merge this PR?
/rebase - this comment automatically rebase on top of main
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@cipolleschi merged this pull request in facebook/react-native@756f89aa59cba78cba39b22a338a3a48bcb38f1b.
This pull request was successfully merged by @okwasniewski in 756f89aa59cba78cba39b22a338a3a48bcb38f1b.
When will my fix make it into a release? | How to file a pick request?