简体   繁体   中英

How to add a private CocoaPod as a dependency in another pod .podspec file?

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.

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'

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?

You have to maintain a repository for your private podspecs.

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM