如何从特定分支安装pod?

Sta*_*ley 84 git xcode cocoapods podfile

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

我试图使用没有最新swift版本的高手,但是有一个分支为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
Run Code Online (Sandbox Code Playgroud)

Von*_*onC 198

podfile指南中提到的语法如下:

要使用repo的不同分支:

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

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

pod 'SQLite.swift', :git => 'https://github.com/stephencelis/SQLite.swift.git', :branch => 'swift3-mariotaku'
Run Code Online (Sandbox Code Playgroud)

  • 标签语法`:tag =>'1.0.0'` (19认同)
  • @AndrewMorris真的.并且提交语法:`:commit =>'0f506b1c45'` (10认同)

yoA*_*ex5 8

具有特定分支的可可足类

[可可足类]

用于:branchPodfile

pod "SQLite.swift", :git => 'https://github.com/stephencelis/SQLite.swift.git', :branch => 'dev'

//additionally you can use :tag, :commit
Run Code Online (Sandbox Code Playgroud)

请注意,该分支必须包含.podspec在根目录中

当您指定时:branch,Cocoapods 将尝试直接在那里查找,.podspec而不是在集中存储库中搜索

[本地 CocoaPods]


osk*_*rko 6

如果只想使用主分支(master),写如下命令:

pod "SAConfettiView", :git => 'https://github.com/oskarko/SAConfettiView.git'
Run Code Online (Sandbox Code Playgroud)

但是如果你想使用一个替代/不同的分支,这个是给你的:

pod "SAConfettiView", :git => 'https://github.com/oskarko/SAConfettiView.git', :branch => 'develop'
Run Code Online (Sandbox Code Playgroud)

十分简单!