0

I am trying to use latest beta tag of MagicalRecord located here:

https://github.com/magicalpanda/MagicalRecord/releases/tag/v2.3.0-beta.5

I am using it in a sdk project that I use in another project. My sdk project will never be a true cocoapod in the repo, but I wrote a podspec to define the transitive deps.

However I am not sure how to list the beta dep of magical record. If I was pointing to the 2.2. version which is published:

  s.dependency 'MagicalRecord', '~> 2.2'

But I really want something like this:

  s.dependency 'MagicalRecord', '~> https://github.com/magicalpanda/MagicalRecord/releases/tag/v2.3.0-beta.5'

I don't want to have to declare MagicalRecord as a dep in both my sdk project and my main project. I would like the main project to list the local sdk as a dep, and have the sdk deps pulled as well. Works great if everything you use is published. What about things that are not published?

lostintranslation
  • 23,756
  • 50
  • 159
  • 262

1 Answers1

1

Cocoapoads support using git endpoints. Per the documentation (http://guides.cocoapods.org/using/the-podfile.html):

To use the master branch of the repo:

pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git'  

To use a different branch of the repo:

pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :branch => 'dev'

To use a tag of the repo:

pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :tag => '0.7.0'

Or specify a commit:

pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :commit => '082f8319af'

I'd recommend using the commit number, as it will provide you with a versioning mechanism.

Community
  • 1
  • 1
danvalencia
  • 251
  • 3
  • 11
  • That syntax is for a Podfile not a podspec. I am writing a podspec for my SDK. My UI will have a Podfile that pulls my SDK. For the UI project to pull the SDK and its deps the SDK needs a podspec file (notice the different syntax). You example works great in a Podfile, not a podspec. http://guides.cocoapods.org/syntax/podspec.html – lostintranslation Jan 10 '15 at 03:56
  • 1
    Ahhhh I see. I think this other question answers this: http://stackoverflow.com/questions/16905112/cocoapods-dependency-in-pod-spec-not-working. TL;DR git option is not available in podspec, but you could work around it by specifying your MagicalRecord dependency in the Podfile (using git syntax) before your SDK dependency. Hope this helps. – danvalencia Jan 10 '15 at 19:14
  • It does help, and that is my current workaround for now. Unfortunate as I really want my SDK deps to be pulled transitively. I.E my SDK depending on MR and the having my UI depend on both the SDK and MR just because I cannot specify the githup dependency kind sucks :/ – lostintranslation Jan 10 '15 at 19:31