ios - 如何创建包含其他 Pod 的 Pod
问题描述
我有一组 Pod,它们构成了我在我的应用程序之间共享的基本常见的自定义扩展和类。
现在这些是我的 Podfile 的一部分
pod 'AuthUtils', :git => 'https://github.com/xxxxx/AuthUtils.git', :tag => '4.2'
pod 'AutoLayoutUtils', :git => 'https://github.com/xxxxx/AutoLayoutUtils.git', :tag => '2.5'
我想将这些组合在一个常见的 Utils Pod 中,例如
pod 'MyAppUtils', :git => 'https://github.com/xxxxx/MyAppUtils.git', :tag => '1.0'
能够安装所有东西,MyAppUtils
但也可以安装一些模块,例如
pod 'MyAppUtils/AuthUtils', :git => 'https://github.com/xxxxx/MyAppUtils.git', :tag => '1.0'
例如,我已经通过https://github.com/SwifterSwift/SwifterSwift和https://github.com/mxcl/PromiseKit看到了这种行为,但我不明白如何实现这种方法。
解决方案
您可以使用subspecs
来实现这一点。你可以去一个实现的项目subspecs
并找到他们的podspec
文件作为参考,或者你可以在CocoaPods 规范指南中找到更多信息
这是子规范的示例:
s.subspec 'SwiftStdlib' do |sp|
sp.source_files = 'Sources/Extensions/SwiftStdlib/*.swift'
end
推荐阅读
- flutter - 如何在抽屉中使用 DrawerControllerState?
- vba - 使用 Outlook VBA 为所有选定的电子邮件添加一个类别
- microsoft-graph-api - 使用 Microsoft Graph Explorer 时在用户邮箱中找不到消息
- tensorflow - relu可以用在神经网络的最后一层吗?
- ajax - 带有 ajax 的 JQuery 数据表,发布 API 调用挂钩
- c# - NAS:System.IO.IOException:系统资源不足,无法完成请求的服务
- python - 如何在给定2个向量和对应角度的信息的情况下找到向量坐标
- python - AttributeError:当我尝试将列表添加为字典python中键的值时,'str'对象没有属性'append'错误
- database - Oracle:转储文件可能是数据泵导出转储文件
- r - 在 R Bookdown 中如何防止/编辑自动表格编号