什么是CocoaPods"(未使用)"

时间:2015-12-03 12:59:29

标签: ios cocoapods

运行pod outdated后,我得到以下输出

Updating spec repo `master`
Analyzing dependencies
The following pod updates are available:
- AFNetworking 2.4.4 -> 2.5.4 (latest version 3.0.0-beta.2)
- HexColors 2.2.1 -> 2.2.1 (latest version 3.0.0)
- Overcoat 3.0.0 -> (unused) (latest version 3.2.1)
- ReactiveCocoa 2.5 -> 2.5 (latest version 4.0.4-alpha-4)

我还没有看到这个"未使用"之前的术语

Overcoat 3.0.0 -> (未使用) (latest version 3.2.1)

这是什么?这是什么意思?

2 个答案:

答案 0 :(得分:4)

在分析了源代码之后,我认为(unused)意味着Pod不在你的Podfile中(可能是你删除了它并且没有重新安装)

AFNetworking     2.4.4    ->      2.5.4            (latest version 3.0.0-beta.2)
    ^              ^                ^                             ^
Pod name     Installed version   Podfile version                Latest

答案 1 :(得分:1)

基于插入此标记的source code,如下所示:

if source_version > lockfile_version
  matching_spec = unlocked_pods.find { |s| s.name == pod_name }
  matching_version =
    matching_spec ? matching_spec.version : '(unused)'
  [pod_name, lockfile_version, matching_version, source_version]
end

看起来这只是意味着CocoaPods无法在你未解锁的pod中找到Pod。

我不能很好地说Ruby,以确定"解锁" pod是(我也不熟悉CocoaPods听过这个术语......但我知道一个' lockfile',也许这是相关的),但是here is the source code for determining that

def unlocked_pods
  @unlocked_pods ||= begin
    pods = []
    UI.titled_section('Analyzing dependencies') do
      pods = Installer::Analyzer.new(config.sandbox, config.podfile).
        analyze(false).
        specs_by_target.values.flatten.uniq
    end
    pods
  end
end
相关问题