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?
CocoaPods is a great tool not only for adding open source code to your project, but also for sharing components across projects. You can use a private Spec Repo to do this.
According to this CocoaPods/issues/2485, CocoaPods/issues/922, the podspecs cannot specify the source of dependencies now. Just use s.dependency 'Apollo/WebSocket', '~> 0.0.1' directly. Free feel to follow this blog's step to create ( pod repo push) a private library.
Add your Private Spec Repo to your CocoaPods installation $ cd ~/.cocoapods/repos/REPO_NAME $ pod repo lint . < 3. Add your Pod's Podspec to your repo Make sure you've tagged and versioned your source appropriately, then run: This will run pod spec lint, and take care of all the little details for setting up the spec in your private repo.
NEXT: Podspec's don't tell you where to get the dependencies, just that your pod has them. BUT...the pod lib lint or pod repo push validations WILL look for the dependency in whatever podspec repos you specify (defaulting to just the public CP one). Fine for public depedencies but for local unhosted development ones it won't be able to find them.
There are a few steps to getting a private pods setup for your project; creating a private repository for them, letting CocoaPods know where to find it and adding the podspecs to the repository. < 1. Create a Private Spec Repo To work with your collection of private pods, we suggest creating your own Spec repo.
You have to maintain a repository for your private podspecs.
Add that repository to your CocoaPods installation:
pod repo add MyPrivateSpecs [email protected]: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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With