一、創(chuàng)建私有庫(kù)
1、創(chuàng)建倉(cāng)庫(kù)
在gitlab上創(chuàng)建兩個(gè)倉(cāng)庫(kù),分別為索引庫(kù)和代碼庫(kù)
索引庫(kù):https://gitlab.com/xxx/xxxspec.git
代碼庫(kù):https://gitlab.com/xxx/xxxSDK.git
2.創(chuàng)建本地工程
pod lib create xxx
根據(jù)需要選項(xiàng)創(chuàng)建相應(yīng)的項(xiàng)目

1.png
3.配置本地spec文件
Pod::Spec.new do |s|
s.name = 'xxx'
s.version = '0.1.0'
s.summary = '數(shù)學(xué)工具'
s.swift_version = '5.0'
s.description = <<-DESC
TODO: Add long description of the pod here.
DESC
s.homepage = 'https://gitlab.com/xxx/xxxsdk.git'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'hi' => 'xxx@xx.com' }
s.source = { :git => 'https://gitlab.com/xxx/xxxSDK.git', :tag => s.version.to_s }
s.ios.deployment_target = '12.0'
s.source_files = 'xxx/Classes/**/*'
end
4.修改或添加源代碼
在xxx/Classes目錄下添加自己的代碼
5.將本地代碼上傳至代碼庫(kù)
進(jìn)入項(xiàng)目目錄
cd existing_repo
關(guān)聯(lián)遠(yuǎn)端代碼庫(kù)
git remote add origin https://gitlab.com/xxx/xxxSDK.git
修改名稱(chēng)
git branch -M main
提交遠(yuǎn)端代碼庫(kù)
git push -uf origin main
提交代碼
git add .
git commit -m "提交信息"
git push -uf origin main
添加tag
git tag -a '版本號(hào)' -m '提交信息'
推送tag
git push --tags
6.添加遠(yuǎn)端索引庫(kù)至本地
pod repo add xxx https://gitlab.com/xxx/xxxspec.git
7.將代碼庫(kù)和索引庫(kù)關(guān)聯(lián)
cd 至本地代碼庫(kù)中spec文件所在文件夾
pod repo push xxx xxxSDK.podspec --verbose --use-libraries --allow-warnings
至此,私有庫(kù)制作完成
二、庫(kù)的更新
1.更新本地代碼及更新pesc中版本號(hào)后提交至代碼庫(kù)
git add .
git commit -m "提交信息"
git push -uf origin main
添加tag
git tag -a '版本號(hào)' -m '提交信息'
推送tag
git push --tags
2.推送pesc至索引庫(kù)
cd 至本地代碼庫(kù)中spec文件所在文件夾
pod repo push xxx xxxSDK.podspec --verbose --use-libraries --allow-warnings
至此,庫(kù)更新完成