-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[Analyzer] Set BUILD_LIBRARY_FOR_DISTRIBUTION for all dependencies if it's set in the user target #9693
Conversation
If BUILD_LIBRARY_FOR_DISTRIBUTION is present in a target (directly in its Build Settings or in an .xcconfig), this setting is also set for all its dependencies. Closes CocoaPods#9232. This commit is based in the following commits: - “Search in users xcconfig’s for figuring out when to set `APPLICATION_EXTENSION_API_ONLY`.WIP” (375c2e1) - “make `Target#application_extension_api_only` a readonly prop” (814cd03) - “make APPLICATION_EXTENSION_API_ONLY not break when performing a cached install” (c319a90) - “[Installer] Add spec for setting APPLICATION_EXTENSION_API_ONLY when the user target has it set” (7e7c3d7, Pull Request CocoaPods#4321)
This commit is based in the following commits: - “add specs for :application_extension_api_only in Analyzer” (89c2798) - “[Installer] Add spec for setting APPLICATION_EXTENSION_API_ONLY when the user target has it set” (7e7c3d7, Pull Request CocoaPods#4321)
@@ -98,6 +98,7 @@ def merge_embedded_pod_targets(embedded_pod_targets_for_build_configuration) | |||
target_definition, client_root, user_project, user_target_uuids, merged).tap do |aggregate_target| | |||
aggregate_target.search_paths_aggregate_targets.concat(search_paths_aggregate_targets).freeze | |||
aggregate_target.mark_application_extension_api_only if application_extension_api_only | |||
aggregate_target.mark_build_library_for_distribution if build_library_for_distribution |
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.
is there a test covering this?
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.
No, there isn't. I copied this from #9142 and there isn't a test for mark_application_extension_api_only
neither (or I haven't found it), so I don't know how to test this.
cc @amorde |
I've fixed all the CI errors except this one: |
Also run |
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.
LGTM besides other comments made already
Thank you for working on this!
You can disable the Rubocop for that specific location by adding |
When this will be released? |
We have 1-2 more things to wrap up before 1.10. Don't have any timelines to give you unfortunately |
@amorde Thanks! |
As discussed in #9232, this PR checks if the
BUILD_LIBRARY_FOR_DISTRIBUTION
Build Setting evaluates toYES
in an user target, and in that case it applies this setting to all the dependencies of this target. This is needed to avoid issues with XCFrameworks.This also checks if
BUILD_LIBRARY_FOR_DISTRIBUTION
is set in a .xcconfig, as proposed forAPPLICATION_EXTENSION_API_ONLY
in #9233.This is both my first PR and my first time working with Ruby, so I heavily based this PR in the previous work with the
APPLICATION_EXTENSION_API_ONLY
Build Setting. I hope I didn't miss anything critical.BTW, thank you for your amazing work in CocoaPods!