在.podspec文件中包括一个私有pod作为另一个私有pod的依赖项 [英] Including a private pod as a dependency of another private pod in .podspec file

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

问题描述

我有2个私人豆荚。我们称它们为 PrivateA PrivateB 。它们以前并不相互依赖,所以我可以像这样很容易地在项目中同时使用它们:

I have 2 private pods. Let's call them PrivateA and PrivateB. These used to not depend on each other, so I could use them both in my project pretty easily like so:

source 'http://my-private-domain.com/PrivateA.git'
source 'http://my-private-domain.com/PrivateB.git'
source 'https://github.com/CocoaPods/Specs.git'

target 'MyProject' do
  use_frameworks!

  # Pods for MyProject
  pod 'PrivateA', :git => 'http://my-private-domain.com/PrivateA.git'
  pod 'PrivateB', :git => 'http://my-private-domain.com/PrivateB.git'
  pod 'lottie-ios', '1.2.1'
end

现在,我意识到 Private A 应该开始于 PrivateB 。由于它们都是私人吊舱,因此我不确定如何修改 PrivateA.podspec 来实现此目的。这是我在 PrivateA.podspec 中尝试过的内容:

Now, I realize that Private A should start depending on PrivateB. Since both of them are private pods, I'm not sure how to modify PrivateA.podspec to make this happen. Here's what I tried in PrivateA.podspec:

s.source = {
  :git => "http://my-private-domain.com/PrivateA.git",
  :git => "http://my-private-domain.com/PrivateB.git"
}

s.dependency "PrivateB"

这是我尝试我的PrivateA pod时遇到的错误:

This is the error I'm getting when trying to pod spec lint my PrivateA pod:

ERROR | [iOS] unknown: Encountered an unknown error (Unable to find a specification for `PrivateB` depended upon by `PrivateA`) during validation.

请帮助!

推荐答案

您应该在 pod spec lint

--sources='http://my-private-domain.com/PrivateA.git,http://my-private-domain.com/PrivateB.git,https://github.com/CocoaPods/Specs.git'

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

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