美文网首页
pod创建私有库

pod创建私有库

作者: yazho | 来源:发表于2017-10-30 16:11 被阅读0次

pod lib create yzPrivatePodDemo

在 yzPrivatePodDemo/yzPrivatePodDemo/Classes 下添加我们要集成的功能类

修改完之后,到Example目录下执行pod install;再次打开example就可以调用之前新增的功能类

修改podspec

lib repo 验证:在目录 yzPrivatePodDemo 根下执行命令。 pod lib lint --allow-warnings

上传 lib repo 到服务器:
$ git remote add origin git@gitlab.com:zlanchun/PrivateLibraryRepo.git
$ git add .
$ git commit -m "Initial commit"
$ git push -u origin master
//tag 值要和podspec中的version一致
$ git tag 0.1.0
//推送tag到服务器上
$ git push --tags

podspec验证: pod spec lint --allow-warnings (用到私有库时候,需要加上--source)

发布 podspec:
添加一个repo: pod repo add NAME URL [BRANCH]
eg: pod repo add tttYZ https://git.coding.net/yzhever/YZSpec.git
推送 podspec 到 Specs repo:pod repo push REPO [NAME.podspec] --sources=xxx,yyy
eg:pod repo push tttYZ yzPrivatePodDemo.podspec --sources=https://git.coding.net/yzhever/YZSpec.git --allow-warnings
eg:pod repo push com-htspecs HTChat.podspec --sources=[] --commit-message="#MERCURY-432# HTChat podSpec" --allow-warnings --use-libraries

pod lib lint --sources=[] --allow-warnings --use-libraries(依赖里有私库,要指定--sources)

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

pod repo update com-yzspec

相关文章

网友评论

      本文标题:pod创建私有库

      本文链接:https://www.haomeiwen.com/subject/ytgcdxtx.html