iOS 创建私有库
2017-07-09 本文已影响0人
爱做梦的星星
创建私有库
文档类型 : 学习笔记
正文
1.创建代码私有库
pod lib create FMBase
2.复制需要的代码替换ReplaceMe.m
3.然后pod install
4.修改xxx-Example
的podSpec

5.验证spec
pod lib lint 本地验证
//注如果包含私有库肯定不过

6.需要这么验证远程

pod spec lint 远程验证 (会验证Tag)
7.打标签
1.先add . 然后commit 然后关联
2.git remote add origin +地址
3.然后push
出现类似错误

原因:与远程的代码仓库版本不同
Remote update ——— remote bebase origin/master
8.打标签
git tag '0.1.0' (一定与你改的spec一致)
9.推标签
git push --tags
10.验证spec
pod spec lint
没问题就搞定推送了
添加到本地私有repo中
pod repo push FMSpecs FMBase.podspec
然后直接检索就有了
Pod search FMBase
//如果搜索不到,删除索引缓存再搜索就可以了
执行rm ~/Library/Caches/CocoaPods/search_index.json

注:项目中使用需要加入索引源(这个时候写podfile要注意加上私有的source 和 共有的source)
image_1bkjahtsm17k4124e1sodqcknn42a.png-54.1kB
最后附加一张私有源使用理解图

//删除本地tag
git tag -d 0.1.0
//删除远程tag
git push origin :refs/tags/0.1.0
验证错误
//description必须必summary长
WARN | description: The description is shorter than the summary.
//精度丢失
WARN | [iOS] xcodebuild: /Users/xingxingliux/Desktop/LXXLib/LRemotePlayerLib/LRemotePlayerLib/Classes/LResourceLoader.m:151:58: warning: implicit conversion loses integer precision: 'long long' to 'NSUInteger' (aka 'unsigned int') [-Wshorten-64-to-32]