可以在 cocoapods 中跳过特定版本的 pod
Possible to skip specific version of pod in cocoapods
我想在 cocoapods 中跳过特定版本的项目,但我没有找到它的方法。以下是 cocoapods.org 的指南页面关于版本控制的内容:
Specifying pod versions
When starting out with a project it is likely that you will want to
use the latest version of a Pod. If this is the case, simply omit the
version requirements. pod 'SSZipArchive' Later on in the project you
may want to freeze to a specific version of a Pod, in which case you
can specify that version number. pod 'Objection', '0.9' Besides no
version, or a specific one, it is also possible to use logical
operators:
'> 0.1' Any version higher than 0.1
'>= 0.1' Version 0.1 and any higher version
'< 0.1' Any version lower than 0.1
'<= 0.1' Version 0.1 and any lower version
除了逻辑运算符,CocoaPods 还有一个乐观运算符 ~>
:
'~> 0.1.2' Version 0.1.2 and the versions up to 0.2, not including 0.2 and higher
'~> 0.1' Version 0.1 and the versions up to 1.0, not including 1.0 and higher
'~> 0' Version 0 and higher, this is basically the same as not having it.
我想要的是安装任何版本,但不是特定版本的 6.6.0。
我找到了这个解决方案,它非常有效:
pod 'FlurrySDK', '!= 6.6.0'
说 pod update
后,结果如下:
Installing FlurrySDK 6.5.0 (was 6.6.0)
这意味着上面的行基本上会跳过版本 6.6.0
并安装项目的最新版本。如果此项目有 6.7.0
版本,它将安装在您的项目中。但是现在(2015 年 8 月 3 日)这个项目的最新版本是 6.6.0
。在这种情况下,此公式的最新版本将为 6.5.0
。
我希望能帮助到别人。
我想在 cocoapods 中跳过特定版本的项目,但我没有找到它的方法。以下是 cocoapods.org 的指南页面关于版本控制的内容:
Specifying pod versions
When starting out with a project it is likely that you will want to use the latest version of a Pod. If this is the case, simply omit the version requirements. pod 'SSZipArchive' Later on in the project you may want to freeze to a specific version of a Pod, in which case you can specify that version number. pod 'Objection', '0.9' Besides no version, or a specific one, it is also possible to use logical operators:
'> 0.1' Any version higher than 0.1
'>= 0.1' Version 0.1 and any higher version
'< 0.1' Any version lower than 0.1
'<= 0.1' Version 0.1 and any lower version
除了逻辑运算符,CocoaPods 还有一个乐观运算符 ~>
:
'~> 0.1.2' Version 0.1.2 and the versions up to 0.2, not including 0.2 and higher
'~> 0.1' Version 0.1 and the versions up to 1.0, not including 1.0 and higher
'~> 0' Version 0 and higher, this is basically the same as not having it.
我想要的是安装任何版本,但不是特定版本的 6.6.0。
我找到了这个解决方案,它非常有效:
pod 'FlurrySDK', '!= 6.6.0'
说 pod update
后,结果如下:
Installing FlurrySDK 6.5.0 (was 6.6.0)
这意味着上面的行基本上会跳过版本 6.6.0
并安装项目的最新版本。如果此项目有 6.7.0
版本,它将安装在您的项目中。但是现在(2015 年 8 月 3 日)这个项目的最新版本是 6.6.0
。在这种情况下,此公式的最新版本将为 6.5.0
。
我希望能帮助到别人。