CocoaPods 系列之一 制作公開庫
CocoaPods 系列之二 更新公開庫
CocoaPods 系列之三 Podspec 語法說明
CocoaPods 系列之四 Podspec subspec
CocoaPods 系列之五 Private Pods(譯文) 制作私有庫
CocoaPods 系列之六 Private Pods 制作私有庫從0到1
CocoaPods 系列之七 我遇到的驗(yàn)證不過
1 在githup創(chuàng)建倉庫
- 創(chuàng)建工程的時候Add a license 要勾選,我這里選的 MIT License。這里的選擇要和podSpec文件里面的對應(yīng)
2 把項(xiàng)目拉到本地,把工程放到項(xiàng)目中,推送上去
3 命令行,輸入 pod trunk me ,如果正確輸出了你的name,email,則下一步;無,則注冊
- pod trunk register xxx@qq.com 'water' --description='water mac'
- pod trunk register 郵箱 "用戶名" --description="電腦描述"
- 然后郵箱收到郵件,點(diǎn)擊鏈接認(rèn)證
4 創(chuàng)建podspec 文件
- pod spec create 文件名
- 關(guān)于里面的內(nèi)容,移步我的簡書,有詳解
5 打tag,推送
git tag 展示當(dāng)前的tag
git tag -a '0.0.1' -m '初始化代碼'
git push origin --tags
6 檢測podspec語法
- pod lib lint 和 pod spec lint
- pod lib lint 會根據(jù)文件檢測配置是否正確。根據(jù)提示修改。
- 檢測的時候會根據(jù) s.source = { :git => "https://github.com/Water95/PodTestDemo.git", :tag => s.version}去找到代碼庫去檢測,因?yàn)楦鶕?jù)這個地址去下載給比人用
- 如果沒有了問題 TestLib.podspec passed validation.
7 推送 pod trunk push HSTestLib.podspec
?? Congrats
?? HSTestLib (0.0.2) successfully published
?? April 25th, 01:45
?? https://cocoapods.org/pods/HSTestLib
?? Tell your friends!
看到這個就成功了
8 pod search HSTestLib 找不到
刪除/Users/xxx/Library/Caches/CocoaPods 下的 search_index.json然后重新search
9 會遇見各種錯誤
- ERROR | name: The name of the spec should match the name of the file.
s.name = "HSTestLib" 要和podspec的名字一致
[!] Unable to accept duplicate entry for: HSTestLib (0.0.2)
不能發(fā)布版本一樣的fatal: Remote branch 0.0.3 not found in upstream origin
找不到tag[!] Unable to interpret the specified path
HSTestLib.podspec
as a podspec (Pod::DSLError).
重新發(fā)了一個tag然后過了
10 地址 https://github.com/hushifei/podTestLibrary
11 PodSpec文件
Pod::Spec.new do |s|
s.name = "HSTestLib"
s.version = "0.0.2"
s.summary = "This is a TestLib."
s.homepage = "http://www.lxweimin.com/u/d1f45ccb900f"
s.license = "MIT"
s.author = {"haohaisheng" => "haohaisheng95@163.com"}
s.platform = :ios, "6.0"
s.source = { :git => "https://github.com/Water95/PodTestDemo.git", :tag => s.version}
s.source_files = "Test", "Test/*/.{h,m}"
s.requires_arc = true
end