post_install do |installer|
copy_pods_resources_path = "Pods/Target Support Files/Pods-TiKu/Pods-TiKu-resources.sh"
string_to_replace = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"'
assets_compile_with_app_icon_arguments = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${BUILD_DIR}/assetcatalog_generated_info.plist"'
#修改后-新增
str1 = 'printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0'
str2 = 'printf "%s\n" "${XCASSET_FILES[@]}" | sort -u | tr \'\n\' \'\\\\0\' | xargs -0 -s 20480 -n 100'
text = File.read(copy_pods_resources_path)
#修改前
# new_contents = text.gsub(string_to_replace, assets_compile_with_app_icon_arguments)
#修改后
new_contents = text.gsub(str1, str2)
File.open(copy_pods_resources_path, "w") {|file| file.puts new_contents }
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 8.0
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
end
end
end
end
参考
网友评论