问题
I've just pushed a private pod to my.domain.com:apps/MyPrivatePod.git
. I'd like to use both this private pod and other public pods in my project
platform :ios, '8.0'
target 'Testing' do
pod 'AFNetworking', '2.6.0 ' // This is supposed to be a public Pod
pod 'MyPrivatePod', '~> 1.1' // This is the private pod I talked about
end
How can I achieve this?
回答1:
Assume you have built the private pod refer to the official docs and push it to your private spec index repo, for example, https://bitbucket.org/<your-name>/specs.git
.
After that, add the spec index repo url into your Podfile
.
source 'https://github.com/CocoaPods/Specs.git' # the official index spec
source 'https://bitbucket.org/<your-name>/specs.git' # your private index spec
Now use them as usual.
target 'foo-target' do
pod 'CocoaLumberjack', '~> 3.2' # public pod, cloned from cocoapods/specs.git
pod 'MyPrivatePod', '~> 1.1' # private pod, cloned from your private specs.git
end
Good luck!
回答2:
Use this and change the path for your private pod path
platform :ios, '8.0'
target 'Testing' do
pod 'AFNetworking', '2.6.0 ' // This is supposed to be a public Pod
pod 'MyPrivatePod', '~> 1.1' , :path => 'libraries/MyPrivatePod/'
end
Hope this helps you
来源:https://stackoverflow.com/questions/45287082/using-private-pod-and-public-pod-in-the-same-project