总结提交 cocoaPods

首先把代码提交仓库 ,打上 tag

如 : git tag 0.0.1
git push origin 0.0.1

在项目目录下执行

pod spec create xxx(项目名)

该命令将在本目录产生一个名为xxx.podspec文件。用编辑器打开该文件,里面已经有非常丰富的说明文档。
最后基本内容如下


Pod::Spec.new do |s|

  s.name         = "xxx"
  s.version      = "0.0.1"
  s.summary      = "xxx summary"
  s.homepage     = "http://yoursite.com"
  s.license      = { :type => "MIT", :file => "LICENSE" }
  s.author             = { "username" => "xxxxx" }
  s.platform     = :ios, "8.0"
  s.source       = { :git => "https://github.com/xxx/xxxxx.git", :tag => "0.0.1" }
  s.source_files  = "xxx/*.{swift,h,m}"
  s.requires_arc = true
end

如果项目依赖别的第三方需要指定s.dependency "JSONKit", "~> 1.4"

执行验证

pod spec lint xxx.podspec
CocoaPods Trunk发布自己的Pods

1、注册Trunk

pod trunk register youremail@mail.com 'someName' --description='some description'

会接受一封验证邮箱
然后命令行执行

pod trunk me

验证一下

Trunk push

pod trunk push 命令会首先验证你本地的podspec文件(是否有错误),之后会上传spec文件到trunk,最后会将你上传的podspec文件转换为需要的json文件。在工程根目录(包含有.podspec)下执行命令:

pod trunk push

如果成功就OK了

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容