Using private pod and public pod in the same project

孤街醉人 提交于 2020-01-05 08:17:36

问题


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

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