我正在尝试创建一个带有嵌套 git 子模块的 CocoaPod。我可以创建 pod,但是我无法完全安装它。
当我运行 pod install --verbose
时,我可以看到运行了 git submodule update --init
而不是 git submodule update --init --recursive
,这不会拉取嵌套子模块。
CocoaPods 是否支持嵌套子模块,还是不支持?我已经搜索网络以寻找潜在线索,但仍未找到任何信息!
我还应该提到的是,使用 pod lib lint
可以通过 lint,但使用 pod spec lint
无法通过。 pod spec lint
抱怨在嵌套子模块中找不到头文件。我不确定这是否与上述问题有关。
(还要注意,我正在开发的这个特定 Pod 只是一个概念验证。我将创建一个更复杂的 Pod,该 Pod 依赖于 socket.IO-objc。不幸的是,socket.IO-objc 不可用作 Pod,并且依赖于 SocketRocket 作为子模块。)
以下是我的 PodSpec:
Pod::Spec.new do |s|
s.name = "DebugTools"
s.version = "0.1.0"
s.summary = "Awesome tools for debugging iOS apps."
s.homepage = "https://github.com/robertcrabtree/DebugTools"
s.license = 'MIT'
s.author = { "Robert Crabtree" => "me@gmail.com" }
s.source = { :git => "https://github.com/robertcrabtree/DebugTools.git", :tag => s.version.to_s, :submodules => true }
s.platform = :ios, '7.0'
s.requires_arc = true
s.source_files = 'Pod/Classes/**/*', 'Pod/Submodules/LogMaster/LogMaster/*.{h,m}', 'Pod/Submodules/LogMaster/LogMaster/LogCore/*.h'
s.resource_bundles = {
'DebugTools' => ['Pod/Assets/*.png']
}
end
这是我的Podfile:
pod "DebugTools", :git => "https://github.com/robertcrabtree/DebugTools.git", :submodules => true