繁体   English   中英

pod规范中Cocoapods的依赖性不起作用

[英]Cocoapods dependency in pod spec not working

我在这个spec文件中遇到语法错误:

Pod::Spec.new do |s|

s.name         = "BSImageLoader"

s.version      = "0.1.3"

s.summary      = "The image loading framework for PicPoc"

s.homepage     = "https://bitbucket.org/boolalsofware/bsimageloader"

s.license      = 'MIT'

s.author       = { "Spencer Comerford" => "Spencevail@gmail.com" }

s.source       = { :git => "git@bitbucket.org:boolalsofware/bsimageloader.git", :tag => "0.1.3" }

s.source_files = 'Classes/*.{h,m}', 'Classes/PublicHeaders/*'

s.public_header_files = 'Classes/PublicHeaders/*.h'

s.dependency = 'BSTiledImageView', :git => 'git@bitbucket.org:boolalsofware/bstiledimageview.git'

s.frameworks = 'QuartzCore', 'AssetsLibrary', 'UIKit'

s.requires_arc = true

end

问题在于依赖点指向了bitbucket repo。 我已经使用本地依赖项,但由于某些原因使用git repo它不起作用。 谢谢你的帮助!

我遇到了同样的问题,发现有另一种方法可以用旧的方式解决这个问题 (感谢@eliperkins)。

假设您有一个主项目Downloader ,它使用较小的项目Player ,它依赖于微型项目FFMpegPlayer 所以你想要的是在你的Player.podspec有一个依赖,如下所示:

s.dependency = 'FFMpegPlayer', :git => '...FFMpegPlayer.git' or 
s.dependency = 'FFMpegPlayer', :local => '../FFMpegPlayer'
s.dependency = 'FFMpegPlayer', :path => '../FFMpegPlayer'
s.dependency = 'FFMpegPlayer', :podspec => '../FFMpegPlayer/FFMpegPlayer.podspec'

但所有这些都不适用于最新版本的Pods,结果证明:local作为副作用达到v0.17.1

从现在开始,您可以在Player.podspec指定干净的依赖关系:

s.dependency = 'FFMpegPlayer' (its ok if that spec does not exist in public)

Downloader (主项目)的Podfile ,您只需 Player pod 之前指定FFMpegPlayer

pod 'FFMpegPlayer', :path => '../FFMpegPlayer' (micro project)
pod 'Player', :path => '../Player' (small project which depends on FFMpegPlayer)

因此,基本上,所有子脚本现在都列在主Podfile中,这保证了pods版本之间没有冲突。

podspec DSL的dependency指令仅支持依赖关系的名称和任何可选的版本要求。 :git选项不受支持。 您可以在Podfile中使用它,或者除主存储库外,您可能还想使用自定义私有存储库。

暂无
暂无

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

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