Carthage:如何获取给定存储库的最新版本?

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

Cartfile 文档做出断言:

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

与矛盾的例子:

# Use the latest version
github "jspahrsummers/xcconfigs"

另外,没有明说,但通过测试,我推断"latest"其实是最新标签的版本。这种解释正确吗?如果是这样,如何指定最新的提交 - 您是否必须手动检查并指定最新的提交,或者是否有更简单的方法?

documentation

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)

所以我相信

github "jspahrsummers/xcconfigs" "HEAD"

应该按预期工作,因为 "HEAD" 是 git rev-parse

的有效参数

或者

github "jspahrsummers/xcconfigs" "master"

或任何其他分支

mdiep 在 Carthage 的 github 页面上回答了这个问题:

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.

只留下版本号。我的看起来像这样并且有效:

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

简直github "jakecraige/RGB"会大喊No tagged versions found for github "jakecraige/RGB"

更好的是使用github "jakecraige/RGB" "master"

您可能想阅读 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.