Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download Podspec dependencies for local development

This seems like something that should be done very easily. I don't know why I just can't seem to find a simple answer to that.

I am creating a pod library that has a pod dependency.

So in my .podspec, I have a s.dependency 'SomePod', '~> 1.0'. Since I am writing my library using SomePod, I want the source files from it in order to import it and use it. Sure one way to do it is to have a PodFile in the repo and then pod install the SomePod.

But is there some other way to download the somePod dependency so that I can use it in my library? What is the best practice around that to have a clean structure?

FYI, I am using the Cookie Cutter library in order to generate all my project structure. What's left for me to do is download those podspec dependencies and avoid using Podfile and pod install since I already have a .xcworkspace generated from Cookie Cutter, so pod install won't like that and will go crazy.

like image 962
Guy Daher Avatar asked Mar 27 '17 17:03

Guy Daher


1 Answers

Well you could handle the dependency management with other Tools (Carthage etc.) or simply on your own (git clone + project integration), but as you are already providing a podspec for your lib, why not just stick to cocoapods for third party lib integration?

This would be the typical approach for your setup, as you just need to write a simple Podfile, assure that SomePod is fetched with the same version as defined in podspec and call pod install.

Advantages:

  • you can still watch third party sources
  • you can debug into third party lib
  • you can compile, test & debug against the exact same version of SomePod that will be fetched from a client project of your lib (no need to keep versions manually in sync)
like image 78
Sven Driemecker Avatar answered Oct 07 '22 23:10

Sven Driemecker