如何从特定分支安装pod?

问题描述 投票:61回答:1

我正在尝试添加一个由cocoapods添加的pod,我正在使用swift 3,而pod(SQlite.swift)。

我试图使用没有最新swift版本的大师,但是有一个branch为swift 3。

那么我应该如何设置我的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
git sqlite cocoapods
1个回答
160
投票

podfile guide提到以下语法:

要使用repo的不同分支:

pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'dev'
                                                                             ^^^
                                                                   (the space is important)

所以在你的情况下,那将是:

pod 'SQLite.swift', :git => 'https://github.com/stephencelis/SQLite.swift.git', :branch => 'swift3-mariotaku'
© www.soinside.com 2019 - 2024. All rights reserved.