cocoapod 上创建自己的代码库

1、建仓库

image.png

2、clone 本地 仓库内准备好要发布的内容

查看pod账号

pod trunk me

注册pod账号

pod trunk register xxxxxx@xx.com 'username'

cd到工程README.md位置 创建podspec

pod spec create podspecFileName

编辑podspec

Pod::Spec.new do |spec|
  
  #存储库名称 会自动读取
  spec.name         = "xxx"
  #版本,与Target一致
  spec.version      = "1.0.0"
  #简介
  spec.summary      = "简介内容"

  spec.description  = <<-DESC
  描述内容
                   DESC
    
  #主页地址
  spec.homepage     = "https://github.com/xxx/xxx"

  #开源协议
  #spec.license      = "MIT (example)"
  spec.license      = { :type => "MIT", :file => "FILE_LICENSE" }

  #作者
  spec.author             = { "438810364@qq.com" => "438810364@qq.com" }

  #支持的平台和版本号
  spec.platform     = :ios, "11.0"

  #托管的git路径
  spec.source       = { :git => "https://github.com/xxx/xxx", :tag => "#{spec.version}" }
  #托管的代码路径 从README.md位置开始
  spec.source_files  = "Classes", "ALHCategory/ALHCategory/ALHCategory/**/*.{h,m}"
  #排除
  spec.exclude_files = "Classes/Exclude"

  #是否支持ARC
  spec.requires_arc = true

  #依赖的第三方
  spec.dependency 'ALHCategory', '~> 1.0.0'

end

3、push工程,新建发布版本,版本号对应

校验podspec文件

pod spec lint 

校验并忽略警告

pod spec lint --allow-warnings

发布

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

相关阅读更多精彩内容

友情链接更多精彩内容