- 开启 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
-
warning
An iOS Deployment target earlier than 8.0 is not supported by this version of Xcode
Xcode11.1 解决链接:https://github.com/CocoaPods/CocoaPods/issues/8069
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
网友评论