cocoapods初始化項(xiàng)目
-
pod lib create FTSmartDeviceModule模板創(chuàng)建項(xiàng)目項(xiàng)目工程 - 初始化項(xiàng)目倉庫
- 1.1.
git init初始化git - 1.2.
git add .將項(xiàng)目的所有文件添加到緩存中 - 1.3.
git commit -m "first commit"將緩存中的文件Commit到git庫 - 1.4. 把遠(yuǎn)程倉庫地址添加到當(dāng)前 終端輸入
git remote add origin https://git.oschina.net/XXX/XXX.git - 1.5 上傳代碼最好先拉一下代碼
git pull origin master如果出現(xiàn)錯誤 issuerefusing to merge unrelated histories解決方式:git pull origin master --allow-unrelated-histories - 1.6 提交代碼到遠(yuǎn)程倉庫
git push origin master
CocoaPods 私有庫集成問題點(diǎn)
- [!] The repo
FXSpecsat../.cocoapods/repos/FXSpecsis not clean解決 cd到repo目錄 查看有沒有沒提交的文件 執(zhí)行
git clean -fpush repo 成功-
私有庫,關(guān)于圖片資源文件的加載和xib的加載 見代碼示例
[[[NSBundle bundleForClass:[MemberCell class]] loadNibNamed:NSStringFromClass([MemberCell class]) owner:self options:nil] lastObject];
更改repo
- 修改代碼,更改podspec 版本對應(yīng),tag版本 提交代碼到遠(yuǎn)程倉庫,創(chuàng)建tag
git tag 0.x提交到遠(yuǎn)程git push --tags - 開始驗(yàn)證倉庫有沒有問題有沒有問題 pod lib lint
- 如果創(chuàng)建的私有庫,依賴于其他私有庫 執(zhí)行 pod lib lint 當(dāng)前文件名.podspec --sources='http://[privateLibName]/cocoaspecs.git,https://github.com/CocoaPods/Specs.git'
- 執(zhí)行命令
pod repo push FTRepostitories FTSmartDeviceModule.podspec --allow-warnings前面是存放podspec文件的repo- 如果里面用到了framework 加參數(shù):--use-libraries
- 執(zhí)行pod search FTSmartDeviceModule
- 執(zhí)行搜索過程中搜索不到刪除緩存索引
rm ~/Library/Caches/CocoaPods/search_index.json就能搜到
- 執(zhí)行搜索過程中搜索不到刪除緩存索引
- [問題]
[!] Unable to find a specification for

image.png