因此,我正在尝试在由 cocoapods 创建的目标中添加文件夹引用。
我找到了这个解决方案,但它对我不起作用。 https://github.com/CocoaPods/CocoaPods/issues/3521
我正在使用 cocoapods 0.39。而且我只将 projects
更改为 pods_project
因为它已被弃用。
还有如何在运行 pod update
时启用日志记录。我尝试了 pod update --verbose
,但我的 puts
没有显示。 :/
===========更新===========
post_install do |installer|
puts "printing tests"
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if target.name == "TargetWhereToAddTheFolderOrFileReference"
source_files = target.source_build_phase.files
folderReference = installer.project.add_file_reference("/AbsolutePath/To/FileOrFolder", installer.project.pod_group("PodGroupWhereToAddTheFileOrFolder"), true)
target.source_build_phase.add_file_reference(btsdata, true)
end
end
end
end
post_install do |installer|
// another post install script is here.
end
我附上了失败的脚本,而且它下面还有另一个 post_install 脚本。 puts "printing tests"
也没有被调用....
=========== 更新完 ===========
最佳答案
哦,我认为脚本只会执行最后的 post_install 而不会 两个都。你能把第一个post_install里面的代码放到最后一个吗?
关于ios - 如何在安装后的 Pod 项目中添加文件夹引用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35615179/