#常用命令 ##私有库 s1: pod lib create 库名
s2: 把需要做成私有库的文件,拖入pods/Development Pods/库名下的class文件夹
s3: 终端输入cd到Podfile所在文件夹,pod install
s4: OSChina 创建代码库,description一定要填,选择导入已有项目,按页面上的命令输入终端
s5:编辑podSpec文件(版本号特别重要)
s6: 执行git add .; 执行git commit -m "初始化”; git push -u origin master;(如果本地or远程库没有需要执行git remote add origin https://gitee.com/qingfengiOS/QFTools)
s7: git tag git tag 0.1.0 git push —tags
s8:提交podSpec文件
cd 到podSpec文件所在文件夹,执行 pod lib lint —allow-warnings等待podSpec文件验证通过,
执行pod repo push QFSpec Tools.podspec --allow-warnings;(如果本地索引库提示没有clean,执行pod repo add QFSpec https://gitee.com/qingfengiOS/QFSpec.git
Over........................
cocoaPods源:https://github.com/CocoaPods/Specs.git
Git 全局设置:
git config --global user.name "四川商旅无忧科技服务有限公司"
git config --global user.email "[email protected]"
创建 git 仓库:
mkdir SlwyBaseTools
cd SlwyBaseTools
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/slwy/SlwyBaseTools.git
git push -u origin master
已有项目?
cd existing_git_repo
git remote add origin https://gitee.com/slwy/SlwyBaseTools.git
git push -u origin master
Care:
-
Swift支持:
echo "3.0" > .swift-version -
文件依赖:
s.source_files = 'SlwyCalendarLib/Classes/**/' s.resources = 'SlwyCalendarLib/Assets/.png'
s.resource_bundles = { 'SlwyCalendarLib' => ['SlwyCalendarLib/Assets/*.png'] }
- 当自己的私有库依赖另外的库(三方库or自己其他的私有库)时,一定要在
s.dependency中写明,否则podSpec文件无法验证通过
s.dependency 'AFNetworking', '> 3.1.0'> 4.1.2'
s.dependency 'SDWebImage', '
s.dependency 'QFRouter', '~> 0.1.1'