创建远程私有索引库
2019-11-26 本文已影响0人
91阿生
之前说了远程公有索引库, 如何想了解的可以去瞧瞧:
https://www.jianshu.com/p/06b98c24592d
私有索引库步骤:
1.创建远程私有索引库
在github上创建一个spec

2.创建远程私有模板项目
在github上创建自定义项目(最好项目名与自定义库名一致)
3.创建本地私有索引库
查看下本地索引库:
pod repo

创建本地有索引库;
pod repo add 远程存放spec的名称 远程私有索引库URL

4.本地创建私有库的模板库
- 终端命令:
pod lib create xxx
- 把自定义库类拖入 Classes文件夹
pod install
- 编辑 xxx.podspec ; 可看公有索引库的设置https://www.jianshu.com/p/06b98c24592d
5.本地创建的私有库的模板库 / tag
5.1> 上传模板项目到github
pod add .
pod commit -m 'xxx'
pod remote add origin github模板项目URL
git push -u origin master
5.2> 设置tag, push tag
注意: tag值必须与xxx.podspec文件中s.version值一致
git tag 0.1.0
git push --tags
提示:删除本地 tag:git tag -d 版本号
删除远程tag:git push origin :refs/tags/远程版本号
6.提交本地私有索引库spec
验证spec: (可执行可不执行, 反正push spec时都会验证)
本地验证: pod lib lint
远程验证: pod spec lint
提交私有索引库
pod repo push 自定义库名 xxx.podspec
7.使用(在本电脑, 其他电脑的使用)
创建一个Demo项目并pod init, 生成Podfile文件

8.关于升级远程私有索引库