cocoapods私有库处理

抽离工具类并提交cocoaPods私有库

最近在提取项目中的部分工具类,有用到cocoaPods私有库,所以把它记录下来。

私有库使用流程

为私有库添加repo

$ pod repo add REPO_NAME git@github:artsy/Specs.git

创建私有库

$ pod repo add REPO_NAME SOURCE_URL

检查repo安装成功

$ cd ~/.cocoapods/repos/REPO_NAME
$ pod repo lint .

把准备好的代码库spec加入到私有库中

该命令会把此版本的.podSpec拷贝到私有库中并push到远程git代码库

$ pod repo push REPO_NAME SPEC_NAME.podspec

.podSpec文件引用其他私有库情况

项目中需要引用到私有库的library,这个时候需要用到 sources

s.dependency 'THLTencentOpenAPI'

$ pod lib lint --sources=https://xx/ThirdSDK.git
$ pod repo push ThirdSDK --sources=https://xx/ThirdSDK.git

包含静态库情况

添加 --use-libraries 忽略掉相关检查

部分问题处理

 The repo `MyRepo` at `../.cocoapods/repos/ThirdSDK` is not clean

 $ pod repo update ThirdSDK
作者

8MilesRD

发布于

2018-03-29

更新于

2019-08-12

许可协议

评论