Carthage: How to get the very latest version of a given repository?

旧街凉风 提交于 2019-12-03 05:35:44

问题


The Cartfile documentation makes the assertion:

If no version requirement is given, any version of the dependency is allowed.

with the contradictory example:

# Use the latest version
github "jspahrsummers/xcconfigs"

Furthermore, it is not stated, but from testing, I infer that "latest" is actually the version of the latest tag. Is this interpretation correct? And if so, how does one specify the very latest commit - do you have to manually check and specify the latest commit, or is there a simpler way?


回答1:


The documentation states

Carthage supports several kinds of version requirements:

  • >= 1.0 for “at least version 1.0”
  • ~> 1.0 for “compatible with version 1.0”
  • == 1.0 for “exactly version 1.0”
  • "some-branch-or-tag-or-commit" for a specific Git object (anything allowed by git rev-parse)

so I believe

github "jspahrsummers/xcconfigs" "HEAD"

should work as expected, since "HEAD" is a valid argument for git rev-parse

Alternatively

github "jspahrsummers/xcconfigs" "master"

or any other branch




回答2:


Simply github "jakecraige/RGB" will yell No tagged versions found for github "jakecraige/RGB"

Better is to use github "jakecraige/RGB" "master"

You may want to read Carthage Tutorial: Getting Started

branch name / tag name / commit name means “Use this specific git branch / tag / commit”. For example, you could specify master, or a commit has like 5c8a74a.




回答3:


This was answered by mdiep on Carthage's github page:

The latest version refers to something that has an actual version—a release or tag. If you want the most latest commit, you need to specify the branch you want to pin to.




回答4:


Just leave the version number out. Mine looks like this and it works:

github "Alamofire/Alamofire"
github "auth0/JWTDecode.swift"


来源:https://stackoverflow.com/questions/31459847/carthage-how-to-get-the-very-latest-version-of-a-given-repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!