1.在Git創(chuàng)建兩個(gè)倉庫,一個(gè)用于存放spec索引文件,一個(gè)存放代碼
2.創(chuàng)建本地repo索引庫 pod repo add xxxspec xxxspec.git(前面一個(gè)xxx是名字暑中,后面這個(gè)就是git上spec倉庫的地址)
3.cd到合適的地方創(chuàng)建本地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 進(jìn)入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本地測(cè)試 pod spec lint xxx.podspec遠(yuǎn)程測(cè) pod repo push xxxxspec xxx.podspec 把 podspec推到遠(yuǎn)程私有索引庫
8.使用私有索引庫
pod search 。。 pod install
完成后repo目錄下的文件層級(jí)是這樣的
本地的.podspec文件要和代碼倉庫里的一樣