cocoapods 私有化仓库specs的创建和使用

1.pod lib create CSHBase  执行后会提示以下内容

What language do you want to use?? [ Swift / ObjC ]

> ObjC

Would you like to include a demo application with your library? [ Yes / No ]

> YES

Which testing frameworks will you use? [ Specta / Kiwi / None ]

>Specta

Would you like to do view based testing? [ Yes / No ]

> YES

What is your class prefix?

> CSH


同样去GitHub或其他的Git服务提供商那里创建一个私有的仓库,拿到SSH地址,然后cd到CSHBase目录

$ git add .

$ git commit -s -m "Initial Commit of Library"

$ git remote add origin git@github.com:kentchen1991/CSHBase.git

$ git push origin master

如果提示冲突 就git pull 一下

然后合并后重新提交一次

因为podspec文件中获取Git版本控制的项目还需要tag号,所以我们要打上一个tag,

$ git tag -m "first release" "0.1.0"

$ git push --tags    #推送tag到远端仓库

开始编辑pod spec文件


编辑完后验证


向Spec Repo提交podspec

我们本仓库已经有了 远程也做了更新

如果出现了repo no clean 则是暂存区没有提交

项目中的使用  podfile 

source 'https://github.com/kentchen1991/XDJSpecs.git'

source 'https://github.com/CocoaPods/Specs.git'

platform :ios,'8.0'

target'Pjtest'do

pod'MBProgressHUD','~> 0.9.1'

pod'MJRefresh'

pod'CSHBase'

end

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容