ios - 如何在安装后的 Pod 项目中添加文件夹引用?

标签 ios xcode cocoapods

因此,我正在尝试在由 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/

相关文章:

ios - "Chord method"结果显示在Label中

ios - 关于在现有 iOS 应用程序中集成 Firebase 的链接问题

android - 移动应用程序必须进行多少处理?

iphone - JTRevealSidebar 推送到 ViewController

ios - 带 UISearchBar 的 LeftBarButtonItem 在 iOS 11 上不可见

xcode - Itunes 连接被拒绝 - 仅限 iPhone

iphone -- XCode 4 在模拟器停止时跳转到 main

ios - 如何使用依赖的 Firebase 创建 Pod 框架

ios - Pod 文件没有被初始化?

ios - 如何在仅纵向的应用程序中以纵向或横向呈现 View Controller