【问题标题】:Cocoapods --no-integrate command for different targetsCocoapods --no-integrate 命令用于不同的目标
【发布时间】:2014-06-16 20:19:56
【问题描述】:

根据http://guides.cocoapods.org/terminal/commands.html#pod_install,如果您想自己集成库或外部依赖项,可以使用 -no-integrate 选项。

基本上我有我的静态库 (comms.a) 和标题 (comms.h)。我的应用程序将导入此库以进行服务器通信。我的应用程序没有使用 cocoapods 进行集成。 (从 xcode 手动链接)。

但我的静态库具有以下结构。

- Comms (main target) [Dependency on AFNetworking using cocoapods]
- CommsTest (test case target) [Dependency on GHUnit using cocoapods]

我的 podfile 应该是什么,这样它才能获取 AFNetworking 但集成取决于我并获取 GHUnit 并集成到我的测试用例目标中。

注意:我不希望我的静态库使用 cocoapods 集成到我的应用程序中。

【问题讨论】:

    标签: static-libraries cocoapods


    【解决方案1】:

    请查看 CocoaPods 中可用的命令行开关:http://guides.cocoapods.org/terminal/commands.html#pod_install

    您会发现--no-integrate 切换到在 Xcode 项目中跳过 Pods 库的集成。

    这意味着 CocoaPod 在这种情况下不会生成 xcworkspace 文件。此外,您必须手动将 Pods.xcodeproj 文件添加到您的主项目中作为子项目。

    在主项目中添加 Pods.xcodeproj 后,您还必须在主项目中添加公共标头和库的引用。

    更多信息可以查看之前的帖子:Building a distributable static library that uses cocoapods

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-15
      相关资源
      最近更新 更多