将私有 pod 作为依赖项添加到 podfile

Add private pod to podfile as dependency

我正在处理使用我创建的另一个私有 pod 的 pod,我需要以某种方式将该 pod 添加为我的 podfile 中的依赖项。

我的播客文件看起来像:

Pod::Spec.new do |spec|

  spec.name             = 'test'
  spec.version          = '0.1'
  spec.license          = { :type => 'BSD' }
  spec.homepage         = 'http://www.test.com'
  spec.authors          = { 'test' => 'test@test.test' }
  spec.summary          = 'test module'
  spec.source           = { :git => 'https://bitbucket.org/test/test', :tag => spec.version.to_s }
  spec.source_files     = 'test'
  spec.requires_arc     = true
  spec.ios.deployment_target = '8.0'
  spec.platform = :ios, '8.0'

  spec.dependency 'SnapKit'

end

我尝试添加为

spec.dependency 'Private pod'

spec.dependency 'Private pod' , :git => 'path-to-bitbucket-repo' 

我寻找了类似的答案,但没有任何建议有效。

P.S。当我尝试时:

pod spec lint DCCalendarMonth.podspec --sources=https://bitbucket.org/test/test.git,master

我得到 The spec did not pass validation, due to 1 error. --verbose 告诉我:

ERROR | [iOS] unknown: Encountered an unknown error (An unexpected version directory `Private pod subdirectory` was encountered for the `/Users/username/.cocoapods/repos/test/test` Pod in the `test` repository.) during validation.

我需要一些帮助或指导,因为我有点绝望了。

谢谢。

找到解决方案:

在 spec.source 字段中,您只需简单地创建具有多个来源的字段:

  spec.source           = { :git => 'https://bitbucket.org/decodehq/test1.git', :tag => spec.version.to_s , 
                            :git => 'https://bitbucket.org/decodehq/test2.git', :tag => spec.version.to_s
                          }