如何在另一个pod .podspec文件中添加私有CocoaPod作为依赖项? [英] How to add a private CocoaPod as a dependency in another pod .podspec file?

查看:4266
本文介绍了如何在另一个pod .podspec文件中添加私有CocoaPod作为依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个私有pod,它依赖于其他私有pod。所以我只想在我的pod .podspec文件中提及它。

I am working on a private pod and that is dependent on other private pod. So i just want to mention it in my pod .podspec file.

它在pod2的.podspec文件中看起来像这样。

Its looks like this in .podspec file of pod2.

s.dependency 'Pod1', '~> 0.0.1' , :git => 'https://github.com/MY_COMPANY/pod1.git', :commit => '9f9f4fe5b5959e0f2ea89e472eccf7aea6f37eea'

我开始知道podspec中没有:git和:commit选项依赖说明符如果不是那么如何实现那个东西?

And i came to know that "there is no :git and :commit options in podspec dependency specifier" so if not then how to achieve that thing?

推荐答案

您必须为私人podspecs维护一个存储库。

将该存储库添加到CocoaPods安装中:

Add that repository to your CocoaPods installation:

pod repo add MyPrivateSpecs git@git.example.com:MyPrivateSpecs

将私有依赖项添加到其中:

Add your private dependency pod to it:

pod repo push MyPrivateSpecs Pod1

现在你可以简单地引用那个pod了你通常会这样:

Now you can simply reference that pod like you normally would:

s.dependency 'Pod1', '~> 0.0.1'

这篇关于如何在另一个pod .podspec文件中添加私有CocoaPod作为依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆