Embed Pods Frameworks
当它为扩展目标添加构建阶段时,我想修复 Cocoapods 错误。那里不需要这些阶段。
https://github.com/CocoaPods/CocoaPods/issues/4203
我写了脚本来删除它
puts "Deleting not needed phases…"
project_path = "Keyboard.xcodeproj"
project = Xcodeproj::Project.open(project_path)
project.targets.each do |target|
if target.name.include?("Extension")
phase = target.shell_script_build_phases.find { |bp| bp.name == 'Embed Pods Frameworks' }
if !phase.nil?
puts "Deleting Embed Pods Frameworks phase…"
target.build_phases.delete(phase)
end
end
end
project.save
我可以手动运行这个脚本pod install
,但我想以某种方式将它添加到 Podfile 中。post_install
它在钩子中不起作用
post_install do |installer|
...
end
因为UserProjectIntegrator.integrate!
在之后调用post_install
,它会覆盖我的更改。
有没有办法将此脚本集成到 Podfile 中?