【发布时间】:2016-07-06 15:44:30
【问题描述】:
当它为扩展目标添加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 中?
【问题讨论】:
-
将它添加到 podfile 是一个不错的主意。这方面有成功吗?
-
@the.evangelist no :( 也没有来自 github 问题的消息。我在“pod install”之后手动运行 ruby 脚本。
-
@pilot34,很高兴在网上认识你 =))