How to install a pod from a specific branch?
我正在尝试通过cocoapods添加pod,我正在使用swift 3,而pod(SQlite.swift)。
我正在尝试使用没有最新Swift版本的母版,但是Swift 3有一个分支。
那么我应该如何设置我的podfile下载特定的分支? 可能吗?
这是我的Podfile:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 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 |
podfile指南提到以下语法:
To use a different branch of the repo:
1 2 3 | pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'dev' ^^^ (the space is important) |
因此,在您的情况下,将是:
1 | pod 'SQLite.swift', :git => 'https://github.com/stephencelis/SQLite.swift.git', :branch => 'swift3-mariotaku' |
如果只想使用主分支(master),请编写以下命令:
1 | pod"SAConfettiView", :git => 'https://github.com/oskarko/SAConfettiView.git' |
但是,如果您要使用替代/不同分支,则该分支适合您:
1 | pod"SAConfettiView", :git => 'https://github.com/oskarko/SAConfettiView.git', :branch => 'develop' |
十分简单! ??