首页 > 其他 > 详细

pod trunk 使用

时间:2021-06-17 16:56:45      阅读:23      评论:0      收藏:0      [点我收藏+]

Pod trunk 使用

创建podspec文件, podspec文件和podfile文件同级

 pod spec create xxxx
# 简介

Pod::Spec.new do |spec|
#  项目名
  spec.name         = "xxx"
#  版本号
  spec.version      = "0.0.1"
#  介绍
  spec.summary      = "A short description of xxx."
#  简介
  spec.description  = <<-DESC
                        这是一个例子
                   DESC
#  主页
  spec.homepage     = "http://EXAMPLE/xxx"
# 开源协议
  spec.license      = { :type => "MIT", :file => "FILE_LICENSE" }
# 开发者
  spec.author             = { "xxx" => "xxx@qq.com" }
# 支持的平台和版本
  spec.platform     = :ios, "9.0"
#  项目地址,以及对应的tag,版本号必须和项目中的tag保持一致
  spec.source       = { :git => "http://EXAMPLE/xxx.git", :tag => "#{spec.version}" }
#  需要的文件
  spec.source_files  = "Classes", "Classes/**/*.{h,m}"
#  列表中要踢出的文件
  spec.exclude_files = "Classes/Exclude"
end

pod lib lint --allow-warnings --verbose

  • --allow-warnings 允许警告
  • --verbose 输出详细信息
  • 如果通过验证会输出 “xxx passed validation.”
  • pod lib lint 只验证本地的能否通过验证
  • pod spec lint 验证本地和远程能否通过
  • 如果是私有的repo库要就上 --sources=“私有库的地址,http://example.git
  • 验证通过后,执行下一步操作

将podspec提交,并打上tag

git add .
git commit -m "xxx"
git push
git tag -a xxx -m "xxx"
git push origin --tags

检查trunk 是否注册

pod trunk me
# 如果注册成功后会显示, 名字,邮箱,注册时间等信息。如果没有注册,进行注册
pod trunk register xxx.@qq.com "name"
# 成功后,会收到邮件,点击验证

推送到cocoapods 的spec

pod trunk push xxx.podspec --allow-warnings --verbose
# 成功后会看到

技术分享图片

pod trunk 使用

原文:https://www.cnblogs.com/jisa/p/14892902.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!