Skip to content
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

[iOS] Use configuration type when adding ndebug flag to pods in release #48193

Conversation

benhandanyan
Copy link
Contributor

@benhandanyan benhandanyan commented Dec 10, 2024

Summary:

While I was working on fixing the iOS debugger logic based on configuration name regex match, I wanted to know if other logic was also based on configuration names. I think I found and fixed the only other configuration name-based logic in the repo in this PR.

Changelog:

[IOS] [CHANGED] - Use configuration type when adding ndebug flag to pods in release

Test Plan:

In a fresh react-native project, I added to the Podfile:

    installer.aggregate_targets.each do |aggregate_target|
      aggregate_target.xcconfigs.each do |config_name, config_file|
          is_release = aggregate_target.user_build_configurations[config_name] == :release
          puts "aggregate_targets #{config_name} is_release: #{is_release}"
        end
    end

    installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
      target_installation_result.native_target.build_configurations.each do |config|
          is_release = config.type == :release
          puts "target_installation_results #{config.name} is_release: #{is_release}"
      end
    end

to confirm my logic. It output the following:

aggregate_targets Release is_release: true
aggregate_targets Local is_release: false
...
target_installation_results Local is_release: false
target_installation_results Release is_release: true
...

I also updated the applicable tests I could find for this logic.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 10, 2024
@@ -664,7 +664,7 @@ def self.add_ndebug_flag_to_pods_in_release(installer)

installer.aggregate_targets.each do |aggregate_target|
aggregate_target.xcconfigs.each do |config_name, config_file|
is_release = config_name.downcase.include?("release") || config_name.downcase.include?("production")
is_release = aggregate_target.user_build_configurations[config_name] == :release
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Dec 10, 2024
@@ -678,7 +678,7 @@ def self.add_ndebug_flag_to_pods_in_release(installer)

installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
target_installation_result.native_target.build_configurations.each do |config|
is_release = config.name.downcase.include?("release") || config.name.downcase.include?("production")
is_release = config.type == :release
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, amazing work. Thank you so much!

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Dec 11, 2024
@facebook-github-bot
Copy link
Contributor

@cipolleschi merged this pull request in 462fae4.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @benhandanyan in 462fae4

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants