CocoaPods podfile 文件配置

记录一下关于 CocoaPods podfile 文件配置

  • 指定源(Source)
    默认情况下,在全局级别指定的源将按照依赖项匹配指定的顺序进行搜索。
    对于特定的依赖,可以单独指定依赖源:
pod 'PonyDebugger', :source => 'https://github.com/CocoaPods/Specs.git'
  • 使用字库(Subspecs)
    当通过Pod的名称安装Pod时,它将安装podspec文件中定义的所有默认subspecs
    可以使用下面的方式导入特定的subspec
pod 'QueryKit/Attribute'

or

pod 'QueryKit', :subspecs => ['Attribute', 'QuerySet']
  • 使用本地私有库(自己创建的本地库)
pod 'AFNetworking', :path => '~/Documents/AFNetworking'

注意,本地私有库中的,podspec文件必须在该文件夹中。

  • 制定分支或者commit

指定源,默认是master分支

pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git'

指定其他分支

pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :branch => 'dev'

使用tag

pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :tag => '0.7.0'

特殊的commit

pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :commit => '082f8319af'

podspec文件应该位于存储库的cocopods 存放的根目录中,如果这个库的存储库中还没有podspec文件,可以从其它来源获得:

pod 'JSONKit', :podspec => 'https://example.com/JSONKit.podspec'
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值