利用pod trunk發(fā)布程序

利用pod trunk發(fā)布程序


注冊(cè)
  • pod trunk register 郵箱 '用戶名' --description='電腦描述'
查收郵件
接下來(lái)查看個(gè)人信息
  • pod trunk me
  - Name:     MJ Lee
  - Email:    xxxxxx@qq.com
  - Since:    January 28th, 03:53
  - Pods:     None
  - Sessions:
    - January 28th, 04:28 - June 5th, 04:34. IP: xxx.xxx.xxx.xxx Description: Macbook Pro
  • 中間可能遇到這種錯(cuò)誤
NoMethodError - undefined method 'last' for #<Netrc::Entry:0x007fc59c246378>
  • 這時(shí)候需要嘗試更新gem源或者pod
    • sudo gem update --system
    • sudo gem install cocoapods
    • sudo gem install cocospods-trunk
創(chuàng)建podspec文件
  • 接下來(lái)需要在項(xiàng)目根路徑創(chuàng)建一個(gè)podspec文件來(lái)描述你的項(xiàng)目信息
    • pod spec cretae 文件名
    • 比如pod spec cretae MJExtension就會(huì)生成一個(gè)MJExtension.podspec
填寫(xiě)podspec內(nèi)容
Pod::Spec.new do |s|
  s.name         = "MJExtension"
  s.version      = "0.0.1"
  s.summary      = "The fastest and most convenient conversion between JSON and model"
  s.homepage     = "https://github.com/CoderMJLee/MJExtension"
  s.license      = "MIT"
  s.author             = { "MJLee" => "xxxxx@qq.com" }
  s.social_media_url   = "http://weibo.com/exceptions"
  s.source       = { :git => "https://github.com/CoderMJLee/MJExtension.git", :tag => s.version }
  s.source_files  = "MJExtensionExample/MJExtensionExample/MJExtension"
  s.requires_arc = true
end
  • 值得注意的是,現(xiàn)在的podspec必須有tag,所以最好先打個(gè)tag,傳到github
    • git tag 0.0.1
    • git push --tags
檢測(cè)podspec語(yǔ)法
  • pod spec lint MJExtension.podspec
發(fā)布podspec
檢測(cè)
  • pod setup : 初始化
  • pod repo update : 更新倉(cāng)庫(kù)
  • pod search MJExtension
倉(cāng)庫(kù)更新
  • 如果倉(cāng)庫(kù)更新慢,可以考慮更換倉(cāng)庫(kù)鏡像
    • pod repo remove master
    • pod repo add master http://git.oschina.net/akuandev/Specs.git
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容