1.在Git创建两个仓库,一个用于存放spec索引文件,一个存放代码
2.创建本地repo索引库 pod repo add xxxspec xxxspec.git(前面一个xxx是名字,后面这个就是git上spec仓库的地址)
3.cd到合适的地方创建本地pod私有模板库 pod lib create xxx
What language do you want to use?? [Swift/ ObjC ]
ObjC
Would you like to include a demo application with your library? [ Yes / No ]
No
Which testing frameworks will you use? [ Specta / Kiwi / None ]
Noe
Would you like to do view based testing? [ Yes / No ]
No
What is your class prefix?
AK
4.把要做成库的代码放入Classes文件夹替换掉replace me 进入Example文件夹里面pod install一下
5.配置spec文件
6.上传代码到git
git add . | git commit -m’x’ | git remote add origin xxx(这里是代码仓库的地址) | git push origin master | git tag ‘0.2.0’ | git push -tags
7.向私有索引库提交spec文件
pod lib lint xxx.podspec本地测试 pod spec lint xxx.podspec远程测 pod repo push xxxxspec xxx.podspec 把 podspec推到远程私有索引库
8.使用私有索引库
完成后repo目录下的文件层级是这样的
本地的.podspec文件要和代码仓库里的一样