-
Notifications
You must be signed in to change notification settings - Fork 25k
feat: set Swift active compilation conditions build setting to DEBUG #42330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: set Swift active compilation conditions build setting to DEBUG #42330
Conversation
Base commit: b41a33e |
|
Hey @cipolleschi, anything I can do to help you get this one merged? |
cipolleschi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I completely missed this PR. 😭
The changes look good. Could you add a test in utils-test.rb file to verify that the build settings is actually added? In this way we can make sure not to miss changes in the set_swift_compilation_conditions method
df39513 to
69f4840
Compare
69f4840 to
d821fef
Compare
|
@cipolleschi I've refactored the method to |
cipolleschi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, thanks for refactoring!
|
/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 756f89a. |
|
This pull request was successfully merged by @okwasniewski in 756f89a. When will my fix make it into a release? | How to file a pick request? |
…acebook#42330) 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: ```swift 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 Pull Request resolved: facebook#42330 Test Plan: Run `bundle exec pod install` and check if the active compilation flags are populated:  Reviewed By: cortinico Differential Revision: D58188103 Pulled By: cipolleschi fbshipit-source-id: 64746f3c7bfbdf47c2dea5e5e8cb2962635b719b
Summary:
This PR adds cocoapods utility to set
SWIFT_ACTIVE_COMPILATION_CONDITIONSto DEBUG, which is set to this value by default (when generating a new native Xcode project).This allows to use the
#if DEBUGcompilator directive in Swift to work out of the box, without any changes on user's side:Changelog:
[IOS] [ADDED] - Set SWIFT_ACTIVE_COMPILATION_CONDITIONS to DEBUG
Test Plan:
Run
bundle exec pod installand check if the active compilation flags are populated: