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