Cocoapods公开的Pod

1.登录https://github.com/,随便见一个仓库
2.复制仓库地址,建议Sourcetree克隆到本地,方便提交
3.找到一个*****.podspec文件,可以先pod本地文件,验证podspec的正确

Pod::Spec.new do |s|

      s.name         = "DMCMNLabel"
      s.version      = '2.0.0'
      s.summary      = "测试"
      s.description  = <<-DESC
                        测试
                       DESC

      s.homepage     = "https://github.com/***/test"
      s.license      = "MIT"
      s.author       = { "dmc" => "809***875@qq.com" }
      s.platform     = :ios, "9.0"
      s.ios.deployment_target = "9.0"
      s.source       = { :git => "https://github.com/***/test", :tag => "#{s.version}" }
      s.frameworks = "UIKit", "Foundation"
      s.requires_arc = true
      s.static_framework = true
 
      #s.dependency 'SDWebImage'
      #s.dependency 'AFNetworking'
      #s.dependency 'XhlNetWorking/API'

      s.source_files  = "DMCMNLabel/**/*.{h,m}"
    end

1.版本要跟xxx.podspec一致, cd到当前目录

git tag -a 0.0.1 -m "version 0.0.1"
git push origin 0.0.1

2.验证源代码与xxx.podspec文件配置是否正确(xxx不能重复),第一次需要,后续更新省略此步骤

 pod spec lint xxx.podspec

3.提交spec到Specs仓库

 pod lib lint xxx.podspec --allow-warnings --use-libraries

4.将.podspec文件提交到gitHub上

pod trunk push 
pod trunk push --allow-warnings//报错可以用这句

首次需要登录,点击邮件验证即可

 pod trunk register xxx@example.com 'nikename'

私有pod

pod 'xxx', :path => '~/本地路径'
pod 'xxx', :podspec => 'https://github.com/AssassinsDevilMayCry/test/xxx.podspec'
//修改源头
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/AssassinsDevilMayCry/test/xxx.podspec'
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容