Including a private pod as a dependency of another private pod in .podspec file

落花浮王杯 提交于 2019-12-12 14:42:33

问题


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

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"

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.

Please help!


回答1:


You are supposed to add this option after pod spec lint

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


来源:https://stackoverflow.com/questions/46738672/including-a-private-pod-as-a-dependency-of-another-private-pod-in-podspec-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!