天天看點

iOS元件化開發一遠端私有庫的更新(三)

一、遠端私有庫的更新

   1、 把新增的類 拖入到 classes 檔案夾中 ;

   2、 修改 pod.spec 檔案的 s.verson = ‘0.2.0';

二、更新遠端倉庫

   1、cd 到本地倉庫的位置,執行以下操;

   2、上傳更新代碼 

git add .
git commit -m '更新描述'
git push origin master      

  3、版本更新這一步非常重要,為更新索引庫做準備  

//版本号要與 s.verson = ‘0.2.0'保持一緻
git tag -a '新版本号' -m '注釋'
git push --tags      
iOS元件化開發一遠端私有庫的更新(三)

四、驗證遠端Spec

//如果報錯可能是你的檔案錯誤,上傳的時候一定要交驗檔案沒有錯誤
pod spec lint —private       

1、終端輸出表示沒有錯誤

iOS元件化開發一遠端私有庫的更新(三)

2、遠端索引庫中有你的版本

iOS元件化開發一遠端私有庫的更新(三)

五、更新遠端和本地索引庫

//pod repo push 索引庫名稱 xxx.podspec
pod repo push gitee-peter_zhang-mobilekitspec  MobileKit.podspec      

六、搜尋下庫pod search MobileKit

pod search MobileKit      

1、如果本地出現所有的新版本和舊版本就表示成功

iOS元件化開發一遠端私有庫的更新(三)

2、pod search: 如果沒有搜到 可以嘗試一下操作

rm ~/Library/Caches/CocoaPods/search_index.json      

七、團隊協作用法

1、找到本地的podfile檔案更改成最新版本0.3.0

#pod預設源
source 'https://github.com/CocoaPods/Specs.git'

source 'https://gitee.com/peter_zhang/MobileKitSpec.git'

#平台工程版本
platform :ios, '8.0'
target 'Ruter' do
#消除警告
inhibit_all_warnings!

#網絡請求(warning~~ acceptableContentTypes加入@"text/html")
pod 'AFNetworking', '~> 3.1.0'

pod 'MobileKit', '~> 0.3.0'

end      

2、

然後cd到podfile所在檔案目錄執行

pod install      

 然後看到控制台輸出表示安裝成功

iOS元件化開發一遠端私有庫的更新(三)