cocoapod私有库创建步骤
1 创建索引库


根据需求创建公开还是私有,第3步license记得选上
2 关联到本地repo list
pod repo addMYModuleSpechttps://github.com/shao621/MYModuleSpec.git

3创建仓库

4 打开终端创建 cd 自己创建的文件夹

pod lib create MYModuleLib(要创建的私有库)

这时候自动弹出创建的私有pods
添加文件到classes


打开1目录, 2 库的名字,3时版本号 4描述 5组件的homepage 6 file必须时LICENSE 7 作者8 路径地址 (需要和github上的一致)9资源路径 10 依赖库(如果需要依赖第三方库需要在这添加)
提交代码
git add .
git commit -m "0.1.0描述"
git remote add origin (远程仓库地址MYModuleLib.git)
git push origin master
git tag 0.1.0
git push --tags
5 验证索引 pod spec lint --allow-warnings
6 验证通过后,pod repo push <本地索引库> <索引文件名> --verbose --allow-warnings 提交索引文件到远程索引库。
pod repo push MYModuleSpec MYModuleLib.podspec --allow-warnings

7 pod search MYModuleLib

8 查看自己是否注册过cocoapods
pod trunk me

9 pod trunk push MYModuleLib.podspec --allow-warnings

10 创建项目


参考文章
cocoapods 私有库创建时遇到的问题 https://www.jianshu.com/p/a66e8123d508
iOS项目组件化遇到的问题及解决(100%遇得到) https://www.jianshu.com/p/1f56c3d78b52
podspec specification does not validate 问题解决 https://www.jianshu.com/p/41cc747a1176
创建私有Pods,从小白到老铁 https://www.jianshu.com/p/97e1d9c6e2fb
网友评论