1. 這次我們使用CocoaPods官方給提供的創建模版庫命令
pod lib create DownLoaderPrivateCP
創建lib模版.png
2. 我們這里編寫好了待公開分享的下載工具庫“DownLoaderPrivateCP”替換模版中ReplaceMe.m文件,本地路徑為:
/Users/trends/Project/Lib/CPRemotePrivateLib/DownLoaderPrivateCP/DownLoaderPrivateCP/Classes/
2.1 執行 pod install 命令添加關聯
3. 在模版工程里編輯DownLoaderPrivateCP.podspec文件。(方法類似[遠程.公開.庫])
3.1 驗證DownLoaderPrivateCP.podspec文件合法性。
驗證合法性.png
4. 我們需要找個遠程托管平臺來放置“DownLoaderPrivateCP”,這里就選用coding.net。
4.1 上傳項目到coding.net。
4.2 標記當前標簽。
5. 在coding.net遠程私有倉庫CPSpecs.git,用來存放自定義遠程私有索引庫.podspec文件。
6. 生成本地索引庫CPSpecs
pod repo add CPSpecs https://git.coding.net/ITEnthusiast/CPSpecs.git
本地索引庫1.png
6.1 這時就可以查看克隆到本地的自定義索引庫。
本地索引庫2.png
6.2 記得要在Xcode工程代碼的Podfile文件里添加本地私有索引庫所關聯的遠程倉庫地址。
??添加Source.png
7. 提交DownLoaderPrivateCP.podspec索引文件至本地索引庫CPSpecs
pod repo push CPSpecs DownLoaderPrivateCP.podspec
提交索引文件.png
8. 搜索使用
pod search DownLoaderPrivateCP
搜索結果.png