把自己写库添加到CocoaPods用pod管理


具体步骤

1 将含有你要上传库的项目添加到 Github
用终端 cd 到该项目下创建.podspec

pod spec create GrenealClass (GrenealClass pod添加的名字)

3 vim GrenealClass.podspec
Pod::Spec.new do|s|
s.name= 'GrenealClass'
s.version= '1.0.0'
s.summary= '非常简单易用的轻量级编辑框’s.homepage= ' https://github.com/lrxlizi/MutipleChoicesDem o'
s.license={ :type=> 'MIT', :file=> 'LICENSE'}s.author={ 'Jonzzs'=> '[email protected]'}s.social_media_url= 'https://blog.csdn.net/qq_33608748. 's.source={ :git=> ' https://github.com/lrxlizi/MutipleChoicesDem o.git', :tag=>s.version}
s.source_files= MultipleChoicesDemo/GrenealClass /*.{h,m}'
s.platform= :ios
s.ios.deployment_target= '9.0'
s.dependency 'Masonry's.subspec 'GroupName 'do|s|
...
end

4. 验证 podspec 文件pod lib lint

• 如果是如下图提示只有 warning 错误,并提示 but you can use '--allow-warnings' to ignore them 的话,就执行以下命令忽略 warning 来验 证:

用 pod lib lint –allow-warnings出现:->GrenealClass (1.0.0)

{ }

GrenealClass passed validation. 验证成功5 给项目打上 tag 版本

  • podspec 文件验证成功后,先将改动后的文件 commit 提交,接着 push 推送 到 GitHub 

  • 然后执行以下命令打上 tag 版本,版本名必须要和之前 podspec 文件中 的 s.version 一致。

    git tag 1.0.0 git push –tags

    {pod lib lint (从本地验证你的 pod 能否通过验证) pod spec lint (从本地和远程验证你的 p od 能否通过验证)}

    GrenealClass passed validation. 验证成功

    给项目打上 tag 版本

    • podspec 文件验证成功后,先将改动后的文件 commit 提交,接着 push 推送 到 GitHub 

    • 然后执行以下命令打上 tag 版本,版本名必须要和之前 podspec 文件中 的 s.version 一致。

      git tag 1.0.0 git push –tags

    注册 tunk
    检测 pod trunk me 是否注册过 注册过

    未注册

pod lib lint (从本地验证你的 pod 能否通过验证) pod spec lint (从本地和远程验证你的 p od 能否通过验证)

因为

CocoaPods

是依赖项目的

tag

版本的,所以必须打上

tag

版本

注册: pod trunk register [email protected] "lrxlizi"

注册完去邮箱

7. 发布到 CocoaPods

pod trunk push GrenealClass.podspec

命令发布

pod trunk push GrenealClass.podspec--allow-warnings

如果刚才是用pod lib lint验证成功的

   

如果刚才是用

pod lib lint--allow-warnings

验证成功的,就执行以下

8 查看一下吧 pod search GrenealClass

详细文档
https://pan.baidu.com/s/1FlCq0z4PqePW7cd6pFxm6g

把自己写库添加到CocoaPods用pod管理

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-15
  • 2022-12-23
  • 2022-12-23
  • 2021-05-13
  • 2022-12-23
  • 2021-11-24
猜你喜欢
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2021-08-23
  • 2021-11-30
  • 2018-01-29
  • 2022-12-23
相关资源
相似解决方案