私有库添加pod,gitlab

作者: littleDad | 来源:发表于2018-06-10 16:36 被阅读18次

1、创建仓库
在gitlab创建2个仓库,specManager用来管理私有三方查找索引;specDemo组件化私有三方远程库;
2、编写代码
注意:在仓库中创建项目,切记项目名不能与到时候的库名相同,否则会无法制作成库文件
1.将远程的specDemo 通过git clone 到本地;

2.创建本地xcode文件放入已经 git init 的文件夹内

3.创建specDemo 的 spec文件 -> pod spec create specDemo

4.编写spec文件
创建成功后需要编写spec文件,具体参数写法可参照官方文档:
https://guides.cocoapods.org/syntax/podspec.html#specification
5.cmd 命令 pod lib lint --verbose --allow-warnings 查看是否被cocoapod 支持

  1. 将私有组件 打上tag
git add .
git commit -m "添加了base和category代码"
git tag -a 0.0.1 -m "添加0.0.1tag"
git push origin --tags
git push

完成后刷新远程git仓库,查看日志

image
7、添加源至本地cocoapods文件夹中
pod repo add AutoziBaseSpec https://git.oschina.net/heeween/AutoziBaseSpec.git
cd ~/.cocoapods/repos/
open .

命令执行后 通过open 查看spec是否存储到了本地
8、提交pod

warn 需要cd到组件化的文件夹下

pod repo push AutoziBaseSpec BeautyKit.podspec --allow-warnings --sources='git@git.dev.adnonstop.com:ios/BeautyKit.git

完成后刷新远程spec仓库看是否有tag组件化工程添加的日志

通过 pod search 组件spec中的name 命令查看 本地日志

xcode创建一个demo名称的工程,退出
cd /Users/heew/Desktop/demo 
pod init 
pod search AutoziBase
  1. 新建xcode工程中的时候
    pod init 后在 podfile中编写
source 'https://github.com/CocoaPods/Specs.git' 【这个都是一样的】
source 'https://git.oschina.net/heeween/AutoziBaseSpec.git'//spec仓库 【私有】
target 'demo' do
pod 'AutoziBase', '~> 0.0.1'
end

私有库

私有库 依赖 私有库

pod spec lint --sources='root@jler.vip:wangwenzhen/AutoBaseSpec.git,https://github.com/CocoaPods/Specs.git' --use-libraries --allow-warnings

pod repo push AutoBaseSpec BGAlertView.podspec --allow-warnings --use-libraries --sources='root@jler.vip:wangwenzhen/AutoBaseSpec.git,https://github.com/CocoaPods/Specs'

相关文章

网友评论

    本文标题:私有库添加pod,gitlab

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