generate_multiple_pod_projects
是CocoaPods 1.7.0 加入的新的屬性觅够,主要是將pod中的文件以project的形式加入到項目中稚疹。在使用generate_multiple_pod_projects
后會有一個新的問題產(chǎn)生帮孔,就是在post_install 中使用下面的方式無法獲取到配置項:
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
end
end
end
主要原因是這時候的pod這個時候pod下面的文件是以project形式存在,所以這時候不能直接去獲取targets來配置項目配置了平绩,需要修改為下面的獲取方式:
post_install do |installer_representation|
installer_representation.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
end
end
end
end