发布一个pod

2019-06-06  本文已影响0人  轻云绿原

发布

1:增加一个podspec文件

pod spec create [NAME|https://github.com/USER/REPO]

2:编辑podspec文件

Pod::Spec.new do |spec|
  spec.name             = 'Reachability'//名字
  spec.version          = '3.1.0'//版本
  spec.license          = { :type => 'BSD' }//许可证:一般是MIT
  spec.homepage         = 'https://github.com/tonymillion/Reachability'//主页
  spec.authors          = { 'Tony Million' => 'tonymillion@gmail.com' }//作者
  spec.summary          = 'ARC and GCD Compatible Reachability Class for iOS and macOS.'//摘要信息
  spec.source           = { :git => 'https://github.com/tonymillion/Reachability.git', :tag => 'v3.1.0' }//源
  spec.source_files     = 'Reachability.h,m'//源文件
  spec.framework        = 'SystemConfiguration'
  spec.requires_arc     = true//是否ARC
  spec.swift_version = '5.0' //swift的版本
end

3 生成 tag

$ cd ~/code/Pods/NAME
$ edit NAME.podspec
# set the new version to 0.0.1
# set the new tag to 0.0.1
$ pod lib lint

$ git add -A && git commit -m "Release 0.0.1"
$ git tag '0.0.1'
$ git push --tags

4 发布

pod trunk push NAME.podspec

5 搜索

检查之前先删除缓存中的json文本

//如果是别人的电脑,要先更新本地库,
pod repo update
// 在自己的电脑里找不到自己发布的pod
rm ~/Library/Caches/CocoaPods/search_index.json
上一篇下一篇

猜你喜欢

热点阅读