美文网首页
Cocoapods 1.7.0 预览

Cocoapods 1.7.0 预览

作者: iVikings | 来源:发表于2019-07-22 14:00 被阅读0次
  • 开启 Cocoapods 新选项,加快项目索引速度
install! 'cocoapods',
:disable_input_output_paths => true,
:generate_multiple_pod_projects => true,
#:incremental_installation => true
post_install do |installer|
  swift_4_2_compatible = [ 'InstantSearchVoiceOverlay' ]
  #installer.pods_project.targets.each do |target|
  installer.pod_target_subprojects.flat_map { |p| p.targets }.each do |target|
    target.build_configurations.each do |config|
      if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 9.0
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
      end
      config.build_settings['SWIFT_VERSION'] = '4.2' if swift_4_2_compatible.include? target.name
    end
  end
end
post_install do |installer|
  installer.generated_projects.each do |project|
    project.build_configurations.each do |config|
        if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 9.0
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
        end
    end
    project.targets.each do |target|
      target.build_configurations.each do |config|
        if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 9.0
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
        end
      end
    end
  end
end

Xcode11.0及以下:

post_install do |installer|
  #installer.pods_project.targets.each do |target|
  installer.pod_target_subprojects.flat_map { |p| p.targets }.each do |target|
    target.build_configurations.each do |config|
      if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 9.0
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
      end
    end
  end
end

相关文章

网友评论

      本文标题:Cocoapods 1.7.0 预览

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