一魂毁、創(chuàng)建spec文件
pod lib create [libName]
二、配置spec文件
[s.name](http://s.name) = 'libName' #名字必須與libname相同
s.version = '1.0.1' #版本必須為0.0.0格式
s.summary = 'all gesture view' #關(guān)于庫(kù)的一個(gè)簡(jiǎn)短描述
s.description = <<-DESC
TODO: 備注文字(較長(zhǎng)描述)
DESC
#是否支持arc
s.requires_arc = true
#文件主頁(yè)
s.homepage = '[https://www.google.com](https://www.google.com)'
#開源協(xié)議
s.license = { :type => 'MIT', :file => 'LICENSE' }
#作者信息
s.author = { 'kiyo' => '[xxxxxx@qq.com](mailto:xxxxxx@qq.com)' }
#源文件所在網(wǎng)絡(luò)路徑
s.source = { :git => '[https://github.com/xxxx/libName.git](https://github.com/xxxx/libName.git)', :tag => s.version.to_s }
#自定義framework所在路徑
s.vendored_frameworks = 'xxxFrameworks/xxx.framework'
#支持版本
s.ios.deployment_target = '8.0'
#公開頭文件名
s.public_header_files = 'Pod/Classes/**/*.h'
#依賴的系統(tǒng)框架
s.frameworks = 'UIKit', 'MapKit'
#依賴的系統(tǒng)靜態(tài)庫(kù)
s.libraries = "sqlite3.0"
#依賴的第三方庫(kù)
s.dependency 'AFNetworking', '~> 2.3'
#Xcode設(shè)置
s.pod_target_xcconfig = { "OTHER_LDFLAGS" => "-ObjC -all_load" }
三出嘹、本地驗(yàn)證spec文件
// 本地驗(yàn)證
pod lib lint [libName]
// 針對(duì)無(wú)法正確找到lib.podspec
pod lib lint --source https://github.com/xxxxx/libName.git
// 忽略警告
pod lib lint --allow-warnings
四席楚、提交到遠(yuǎn)端倉(cāng)庫(kù)
// cd到lib目錄下
cd [libFolder]
// 由于lib已經(jīng)在git版本控制下就不需要初始化,直接添加文件提交
git add -A
git commit -s -m "Initial Commit of Library"
// 添加遠(yuǎn)端倉(cāng)庫(kù)
git remote add origin [https://github.com/xxxx/libName.git](https://github.com/xxxx/libName.git)
// 提交到遠(yuǎn)端倉(cāng)庫(kù)
git push orgin master
五税稼、遠(yuǎn)程驗(yàn)證spec文件
// 遠(yuǎn)端驗(yàn)證
pod spec lint [libName]
六烦秩、打上Tag
git tag -m "first commit" "1.0.1"
git push --tags
七垮斯、注冊(cè)發(fā)布自己的Pods(已注冊(cè)跳過該步驟)
// 通過郵箱和用戶名注冊(cè)
pod trunk register [mail] [mailName] --description='xxx'
- 等到到一份郵件,點(diǎn)擊郵件中的鏈接后驗(yàn)證是否可以查到自己信息
// 驗(yàn)證注冊(cè)是否成功
pod trunk me
八只祠、發(fā)布到cocoapods
// 在工程根目錄(包含有.podspec)
pod trunk push libName.podspec
刪除指定pod版本
pod trunk delete PODNAME VERSION
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者