繁体   English   中英

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

[英]Add private pod to podfile as dependency

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

我的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' 

我寻找类似的答案,但没有建议的作品。

PS当我尝试:

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
                          }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM