@sebastianv1 hello :), I have been trying to take advantage of the generate_multiple_pod_projects feature and although I have read the original pitch thread (hopefully well :)) and seen the hints in how to migrate current post install hooks, I am unable to put them in practice successfully:
This is the kind of hooks I am trying to run and convert to CocoaPods post the multiple pod projects flag:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['VALID_ARCHS'] = 'arm64'
config.build_settings['VALID_ARCHS[sdk=iphonesimulator*]'] = 'x86_64'
if "#{target.name}" == "XMPPFramework" || "#{target.name}" == "FBSDKCoreKit" || "#{target.name}" == "Bolts" || "#{target.name}" == "Mantle" || "#{target.name}" == "Tune"
config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = 'YES'
end
end
end
end
In some cases, I have had to override the deployment target or the Swift version, but it is a variation of the changes above.
It would be really appreciated some help in converting that and maybe adding instructions to the README for 1.7.0. Thank you in advance!
@Panajev For incremental_installation
, we added some new properties to Pod#Installer
that I would recommend using regardless of whether or not your project actually uses the incremental option.
# @return [Array<Project>] The list of projects generated from the installation.
#
attr_reader :generated_projects
# @return [Array<PodTarget>] The list of pod targets that were generated from the installation.
#
attr_reader :generated_pod_targets
# @return [Array<AggregateTarget>] The list of aggregate targets that were generated from the installation.
#
attr_reader :generated_aggregate_targets
So for your post-install hook example, replacing installer.pods_project
with installer.generated_projects
should prevent any exceptions. It's also worth noting that due to the nature of incremental installation, the post install hook may not get applied to all of your targets as we only install the set of targets that have changed since the last installation. So when adding a new post install hook that you'd like to be applied to all targets in your project right away, you should pass the --clean-install
flag to pod install
or pod update
.
Thank you @sebastianv1 , for completeness (still testing the results), this seems to be what I was looking for (no errors) based on your response:
install! 'cocoapods', :generate_multiple_pod_projects => true
[...]
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['VALID_ARCHS'] = 'arm64'
config.build_settings['VALID_ARCHS[sdk=iphonesimulator*]'] = 'x86_64'
if "#{target.name}" == "XMPPFramework" || "#{target.name}" == "FBSDKCoreKit" || "#{target.name}" == "Bolts" || "#{target.name}" == "Mantle" || "#{target.name}" == "Tune"
config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = 'YES'
end
end
end
end
end
Most helpful comment
Thank you @sebastianv1 , for completeness (still testing the results), this seems to be what I was looking for (no errors) based on your response: