CocoaPods: point to a branch in pod spec
Asked Answered
P

2

46

I'm trying to install code from a repository's branch on a pod spec, and based on the documentation, this should work:

s.dependency 'repository_name',
:git => 'https://github.com/account_name/repository_name.git',
:branch => 'experimental_branch'

But I get an error with something like [!] Unsupported version requirements. Updating CocoaPods might fix the issue.

It works when installing from a pod file directly:

pod 'ObjectiveRecord', :git => 'https://github.com/supermarin/ObjectiveRecord.git', :branch => '2-0-experimental'

Does anyone know? Thanks!

Peaceable answered 5/8, 2014 at 13:45 Comment(0)
H
53

You can't use a pod dependency like that, it only supports "name", "version". Source: guides.cocoapods.org. It is expected that the :git and :branch metadata will come from the podfile.

Hygienic answered 5/8, 2014 at 14:31 Comment(4)
Thanks! I guess I was pushing the limits of cocoapods ;)Peaceable
The response should be accepted as valid if it helped you.Frasquito
This answer appears to be outdated. Since it's coming up on Google, would you mind updating it?Walden
Doesn't look like it, go through to the link I posted, it's still just those two options.Hygienic
V
-1

Please check the discussion here - Link

I think it is possible now as per the discussion but initially -

They suggested Tag instead of the branch as the problem with a branch vs a tag is that a branch does not specify a specific point in the history, whereas a tag does. This distinction is very important, as we need to guarantee that depending on a specific version of the library will result in using the same source every time. Technically it is possible to delete a tag and create it again pointing to a different commit, but this is less likely to happen.

Vendue answered 18/3, 2020 at 13:9 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.