2

I'm trying to set a maximum pod version into my 'Podfile', like AFNetworking does:

pod 'AFNetworking', '~> 2.0'

But I'm using a private repository so I also need to specify the git repository:

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

The cocoapods Guide: https://guides.cocoapods.org/using/the-podfile.html examples show how to use a specific branch, tag or commit:

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

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

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

But no maximum pod version.

How can I combine the private git repository AND a maximum pod version?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Raphaël Pinto
  • 653
  • 8
  • 20

1 Answers1

1

When using a podspec from the root of a repository (i.e, when you put :git in your Podfile), CocoaPods will be using the podspec within the root of that repository. A podspec will have a fixed version number attached, therefore there is no such thing as a "maximum" version, there is only, one fixed version.

If instead, you would like to publish a variety of versions of your private Pod, you could include the various versions as separate pod specs within a pod spec repository, take a look at the CocoaPods guide on private spec repositories.

kylef
  • 1,066
  • 1
  • 8
  • 11
  • So what the '~> 2.0' stand for into my project podfile if it automatically uses the podspec present at the root of the AFNetworking git repository? Ok, I think I understand, my private repository (I already have one) link to my Pods git repos which uses the podspecs to know the actual pod version to use. – Raphaël Pinto Aug 05 '15 at 13:20