1. 程式人生 > >製作cocoapods第三方庫

製作cocoapods第三方庫

建立倉庫

克隆到本地,建立專案到倉庫

建立描述檔案 GWLPodTest.podspes

pod spec create GWLPodTest

編輯GWLPodTest.podspes檔案,描述檔案引數描述及更多引數可參考官網文件

Pod::Spec.new do |spec|

  spec.name         = "GWLPodTest"
  spec.version      = "0.0.1"
  spec.summary      = "一個簡單的介紹."
  spec.homepage     = "https://github.com/gwlCode/GWLPodTest"
  spec.license      = "MIT"
  spec.author       = { "gwl" => "[email protected]" }
  spec.platform     = :ios, "9.0"
  spec.source       = { :git => "https://github.com/gwlCode/GWLPodTest.git", :tag => "#{spec.version}" }
  spec.source_files = "Classes", "GWLPodTest/GWLPodTest/Classes/**/*.{h,m}"
  spec.requires_arc = true

end

上傳專案到git倉庫,建立Release版本

驗證podspec

pod spec lint

驗證成功提示

pod主幹註冊

pod trunk register [email protected] "gwl"

開啟郵箱檢視郵件

瀏覽器開啟郵箱接收的地址

釋出pod

pod trunk push GWLPodTest.podspec

釋出成功後提示

執行pod trunk push GWLPodTest.podspec釋出,會提示錯誤資訊:[!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down,可多次執行 pod trunk push GWLPodTest.podspec 重複釋出可成功,或尋找解決辦法

測試GWLPodTest庫