標籤:register 源檔案 tags detail 選項 依賴庫 work 使用 csdn
參考:http://www.cnblogs.com/SimonGao/p/4987668.html
參考:http://www.cnblogs.com/yueyuanyueyuan/p/5560954.html
參考:http://blog.csdn.net/wzzvictory/article/details/20067595
參考:http://www.jianshu.com/p/d7d1942dd3f1
1. 工程
- 引用的第三方庫,不能用#import<> 而用#import"" 設定功能的搜尋選項 "Always search user paths"為YES
- 庫裡的檔案不要有測試工程
- 上傳到github
2. 製作2.1. 添加 .podspec 檔案2.1.1. 建立
- 必須檔案
- 使用命令 pod spec create name.podspec
- 或者直接拷貝一份
2.1.2. 新增內容
- 必須
- 來到倉庫根目錄
- 添加pods依賴庫需要一個描述檔案,並且檔案名稱要和依賴庫的名稱一樣。
- s.source_files 是源檔案路徑
Pod::Spec.new do |s| s.name = "ColorfulWoodUIBase" s.version = "1.0.1" s.summary = "User Interface Design." s.homepage = "https://github.com/gs01md" s.license = "MIT" s.author = { "ColorfulWood" => "[email protected]" } s.source = { :git => "https://github.com/gs01md/ColorfulWoodUIBase.git", :tag => "#{s.version}" } s.source_files = "ColorfulWoodUIBase/ColorfulWoodUIBase/**/*" s.platform = :ios s.frameworks = ‘UIKit‘ s.dependency ‘Masonry‘end
2.2. 上傳 podspec檔案2.1.1. 為 pod 添加版本號碼並打上tag
git tag -m "first release ColorfulWoodUIBase with podspec" "1.0.1"git push --tags
2.1.2. 驗證
pod lib lint ColorfulWoodUIBase.podspec
2.1.3. 註冊
pod trunk register [email protected] "ColorfulWood" --description="macbook pro"
2.1.4. 上傳
pod trunk push ColorfulWoodUIBase.podspec
IOS 上傳自己的庫到cocoapod