CocoaPods创建私有库

2019-01-19  本文已影响0人  蜗牛的马达

大致步骤

创建远端索引库

什么是远端索引库
每创建一个组件都会带有一个xxx.podspec的索引文件。专门用来存放这些索引文件的库就叫做索引库。我们需要把这些索引库文件上传到远程索引库才能保证其他同事能够拿来使用。

创建远程索引库(这里是在github上创建一个public的organization名字叫LQComponent),自己公司的项目创建private的私有索引库即可,私有索引库的步骤和public的操作方式一样。


image.png

远程索引库已经创建成功,可以看到远程索引库的地址


image.png

本地索引库

//隐藏文件
defaults write com.apple.finder AppleShowAllFiles -boolean false ; killall Finder
//显示文件
defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder
image.png

远程代码库(代码实际存放的远程仓库)

创建远程代码仓库(和创建远程索引库的方式一样),创建一个LQCategory的远程代码库,用来存放Category组件的代码。


image.png
image.png

本地代码库

创建LQCategory组件的远程代码库以后,需要创建本地代码库

git add .
git commit -m "xxx"
git remote add origin 远程代码仓库地址
git push origin master 或者 git push -u origin master(一般第一次提交用)
git tag 版本号/git tag -a 版本号 -m "version版本号"(注:这里的版本号必须和podspec里写的版本号一致)
git tag 查看版本号是否提交成功
git push --tags

  pod repo push LQSpecs LQCategory.podspec --verbose --allow-warnings

查看本地是否成功


image.png
上一篇 下一篇

猜你喜欢

热点阅读