xcode 如何从特定分支安装 pod?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39930664/
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
How to install a pod from a specific branch?
提问by Stanley
I'm trying add add a pod by cocoapods, and I am using swift 3, while the pod(SQlite.swift).
我正在尝试通过 cocoapods 添加一个豆荚,我使用的是 swift 3,而豆荚(SQlite.swift)。
I am trying to use doesn't have a master of the latest swift version, however there is a branchfor swift 3.
我正在尝试使用没有最新 swift 版本的大师,但是swift 3有一个分支。
So how should I set my podfile to download the specific branch? Is it possible?
那么我应该如何设置我的 podfile 来下载特定的分支?是否可以?
Here is my podfile:
这是我的 podfile:
platform :ios, '10.0'
target 'RedShirt' do
use_frameworks!
# Pods for RedShirt
pod 'SQLite.swift', :git => 'https://github.com/stephencelis/SQLite.swift.git'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
回答by VonC
The podfile guidementions the following syntax:
该podfile指南中提到的语法如下:
To use a different branch of the repo:
要使用 repo 的不同分支:
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'dev'
^^^
(the space is important)
So in your case, that would be:
所以在你的情况下,那将是:
pod 'SQLite.swift', :git => 'https://github.com/stephencelis/SQLite.swift.git', :branch => 'swift3-mariotaku'