xcode 如何从特定分支安装Pod?

q1qsirdb  于 2022-12-24  发布在  其他
关注(0)|答案(3)|浏览(160)

我正在尝试添加一个豆荚,我使用的是swift 3,而豆荚(SQlite.swift)。
我尝试使用没有掌握最新的swift版本,但是有一个branch的swift 3。
那么我应该如何设置我的播客文件来下载特定的分支呢?有可能吗?
下面是我的播客文件:

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
iklwldmw

iklwldmw1#

podfile指南提到了以下语法:
要使用存储库的其他分支:

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'
9rnv2umw

9rnv2umw2#

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

pod "SAConfettiView", :git => 'https://github.com/oskarko/SAConfettiView.git'

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

pod "SAConfettiView", :git => 'https://github.com/oskarko/SAConfettiView.git', :branch => 'develop'

很简单!😊

ggazkfy8

ggazkfy83#

有特殊分支的椰子

Cocoapods(https://stackoverflow.com/a/59257708/4770877)
Podfile中使用:branch

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

//additionally you can use :tag, :commit

请注意,该分支必须在根目录中包含.podspec
当您指定:branch时,Cocoapods将尝试直接在那里查找.podspec,而不是在集中式存储库中搜索
Local CocoaPods(https://stackoverflow.com/a/57812997/4770877)

相关问题