-
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
Unable to customize schemes before projects are written. #9379
Comments
We do not want to move that currently as it will break a ton of projects which they will need to add Additionally we actually prefer the user to be able to modify the project before |
I think you misunderstood, I'm proposing moving the hook to before project.save is called but after def write!
cleanup_projects(projects)
projects.each do |project|
UI.message "- Writing Xcode project file to #{UI.path project.path}" do
library_product_types = [:framework, :dynamic_library, :static_library]
results_by_native_target = Hash[pod_target_installation_results.map do |_, result|
[result.native_target, result]
end]
project.recreate_user_schemes(false) do |scheme, target|
next unless target.respond_to?(:symbol_type)
next unless library_product_types.include? target.symbol_type
installation_result = results_by_native_target[target]
next unless installation_result
installation_result.test_native_targets.each do |test_native_target|
scheme.add_test_target(test_native_target)
end
end
end
end
run_podfile_post_install_hooks
projects.each do |project|
project.save
end
end |
ah...hmmm I think that would work we can try opening up a PR and see if tests fail for starters. |
🌈 We would like to modify the visibility of specific schemes before our projects are written/saved to disk.
Unfortunately, this is not supported by podfile post install hooks because
projects_writer.write!
overwrites the visibility of all the schemes.CocoaPods/lib/cocoapods/installer.rb
Lines 322 to 326 in c1292cc
CocoaPods/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb
Lines 38 to 59 in c1292cc
Ideally we would
run_podfile_post_install_hooks
after the PodsProjectWriter callsrecreate_user_schemes
on all the projects but before it calls save on all the projects.I'd be willing to make a PR if this approach is acceptable.
Thanks!
The text was updated successfully, but these errors were encountered: