cocoapods初始化项目
-
pod lib create FTSmartDeviceModule模板创建项目项目工程 - 初始化项目仓库
- 1.1.
git init初始化git - 1.2.
git add .将项目的所有文件添加到缓存中 - 1.3.
git commit -m "first commit"将缓存中的文件Commit到git库 - 1.4. 把远程仓库地址添加到当前 终端输入
git remote add origin https://git.oschina.net/XXX/XXX.git - 1.5 上传代码最好先拉一下代码
git pull origin master如果出现错误 issuerefusing to merge unrelated histories解决方式:git pull origin master --allow-unrelated-histories - 1.6 提交代码到远程仓库
git push origin master
CocoaPods 私有库集成问题点
- [!] The repo
FXSpecsat../.cocoapods/repos/FXSpecsis not clean-
解决 cd到repo目录 查看有没有没提交的文件 执行
git clean -fpush repo 成功 -
私有库,关于图片资源文件的加载和xib的加载 见代码示例
[[[NSBundle bundleForClass:[MemberCell class]] loadNibNamed:NSStringFromClass([MemberCell class]) owner:self options:nil] lastObject];
-
更改repo
- 修改代码,更改podspec 版本对应,tag版本 提交代码到远程仓库,创建tag
git tag 0.x提交到远程git push --tags - 开始验证仓库有没有问题有没有问题 pod lib lint
- 如果创建的私有库,依赖于其他私有库 执行 pod lib lint 当前文件名.podspec --sources='http://[privateLibName]/cocoaspecs.git,https://github.com/CocoaPods/Specs.git'
- 执行命令
pod repo push FTRepostitories FTSmartDeviceModule.podspec --allow-warnings前面是存放podspec文件的repo- 如果里面用到了framework 加参数:--use-libraries
- 执行pod search FTSmartDeviceModule
- 执行搜索过程中搜索不到删除缓存索引
rm ~/Library/Caches/CocoaPods/search_index.json就能搜到
- 执行搜索过程中搜索不到删除缓存索引
- [问题]
[!] Unable to find a specification for
image.png









网友评论