xcode Carthage:如何获取给定存储库的最新版本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31459847/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Carthage: How to get the very latest version of a given repository?
提问by Chris Conover
The Cartfile documentation makes the assertion:
Cartfile 文档做出以下断言:
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?
此外,它没有说明,但从测试中,我推断“最新”实际上是最新标签的版本。这个解释正确吗?如果是这样,如何指定最新的提交 - 您是否必须手动检查并指定最新的提交,还是有更简单的方法?
回答by Gabriele Petronella
The documentationstates
该文件指出
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)
Carthage 支持多种版本要求:
- >= 1.0 表示“至少版本 1.0”
- ~> 1.0 表示“与 1.0 版兼容”
- == 1.0 表示“正好是 1.0 版”
- 特定 Git 对象的“some-branch-or-tag-or-commit”(git rev-parse 允许的任何内容)
so I believe
所以我相信
github "jspahrsummers/xcconfigs" "HEAD"
should work as expected, since "HEAD" is a valid argument for git rev-parse
应该按预期工作,因为“HEAD”是 git rev-parse
Alternatively
或者
github "jspahrsummers/xcconfigs" "master"
or any other branch
或任何其他分支
回答by onmyway133
Simply github "jakecraige/RGB"
will yell No tagged versions found for github "jakecraige/RGB"
简直github "jakecraige/RGB"
会大喊大叫No tagged versions found for github "jakecraige/RGB"
Better is to use github "jakecraige/RGB" "master"
更好的是使用 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.
分支名称/标签名称/提交名称的意思是“使用这个特定的git branch/tag/commit”。例如,你可以指定 master,或者一个提交像 5c8a74a。
回答by Chris Conover
This was answered by mdiep on Carthage's github page:
这是由 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.
最新版本是指具有实际版本的东西——发行版或标签。如果您想要最新的提交,则需要指定要固定到的分支。
回答by Qian Chen
Just leave the version number out. Mine looks like this and it works:
只留下版本号。我的看起来像这样,它有效:
github "Alamofire/Alamofire"
github "auth0/JWTDecode.swift"