参考链接:创建私有pods库
遇到的坑:
1、创建私有库的时候,如果私有库依赖的有三方公共库
podspec 里添加
s.dependency 'AFNetworking' , '~> 3.0'
s.dependency 'YYModel'
需要在--sources后面添加公有仓库地址https://github.com/CocoaPods/Specs.git,而不是对应的具体git地址
pod repo push TestSpec TestSpec.podspec --sources=https://github.com/xxx/TestSpec.git,https://github.com/CocoaPods/Specs.git
如果依赖的有其他私有库 extension
pod repo push TestSpec TestSpec.podspec --sources=https://github.com/xxx/TestSpec.git,https://github.com/xxx/extension.git
2、pod repo add realTimeBusCocoaRepo https://gitlab.com/iosCocoaPods4CMS/iOS_Cocoapods_Repo.git
添加本地索引目录之后,本地索引需要先随便儿提交点儿什么到github,比如新增个READ.ME,然后push 到master,不然后续提交索引的时候会持续报错无索引文件:Your configuration specifies to merge with the ref 'refs/heads/master' from the remote, but no such ref was fetched.