Cartfile 文档做出断言:
If no version requirement is given, any version of the dependency is allowed.
举个矛盾的例子:
# Use the latest version
github "jspahrsummers/xcconfigs"
另外,没有明说,但通过测试,我推断“latest”实际上是latest标签的版本。这种解释正确吗?如果是这样,如何指定最新的提交 - 您是否必须手动检查并指定最新的提交,或者是否有更简单的方法?
最佳答案
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"
或任何其他分支机构
关于ios - Carthage:如何获取给定存储库的最新版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31459847/