【问题标题】:Creating private cocoapod, git tag issue创建私有cocoapod,git标签问题
【发布时间】:2016-07-06 13:59:57
【问题描述】:

我已成功创建静态库 MyCore,并创建了相关存储库。
然后我以这种方式创建了 MyCore.podspec

Pod::Spec.new do |s|
    s.name         = "MyCore"
    s.version      = "0.1.4"
    s.summary      = "..."
    s.description  = "..."
    s.homepage     = "https://foo.com/MyCore"
    s.license      = '...'
    s.platform     = :ios, "8.0"
    s.source       = { :git => "https://foo.com/MyCore.git", :tag => s.version.to_s }
    s.source_files  = 'MyCore/*.swift'
end

我跑

pod spec lint --allow-warnings

并且 podspec 通过了验证。

很好,比在我的项目中我有 podfile:

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'
use_frameworks!
inhibit_all_warnings!

target 'MyProject' do

    pod 'MyCore', :git => 'https://foo.com/MyCore.git'

end

当我运行 'pod install' 时,我的 pod 已安装,但没有像我预期的那样在最后一个标签 (0.1.4) 处安装:

Installing MyCore 0.1.0 

有什么想法吗?

【问题讨论】:

  • 您的Podfile.lock 文件对MyCore 有什么看法?另外,pod outdated 的输出是什么?

标签: ios swift git cocoapods


【解决方案1】:

对于未存储在规范存储库中的私有 pod,Cocoapods 无法找到用于比较版本号的参考。

然后运行以下命令强制更新。

pod update

【讨论】:

  • 我运行 'pod update' 但它安装的是 0.1.0 版本,而不是 0.1.4。
  • 你是否有可能在除 master 之外的其他分支上?
  • 没办法,我已经用项目的分支/标签屏幕更新了问题
【解决方案2】:

我认为除了pod spec lint --allow-warnings,您还必须推动更改。

所以这是一个完整的步骤

  1. pod spec lint --allow-warnings # 假设前面成功。
  2. git tag -a 0.1.4; git push --tags # 你现在必须创建一个标签
  3. pod repo push SpecsRepo MyCode.podspecs#推送podspec文件

【讨论】:

    猜你喜欢
    • 2015-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-30
    • 1970-01-01
    相关资源
    最近更新 更多