美文网首页
CocoaPods generate_multiple_pod_

CocoaPods generate_multiple_pod_

作者: 蛋哥是只猫 | 来源:发表于2022-05-18 11:20 被阅读0次

generate_multiple_pod_projectsCocoaPods 1.7.0 加入的新的属性,主要是将pod中的文件以project的形式加入到项目中。在使用generate_multiple_pod_projects后会有一个新的问题产生,就是在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

相关文章

网友评论

      本文标题:CocoaPods generate_multiple_pod_

      本文链接:https://www.haomeiwen.com/subject/xcfaurtx.html