为现有的GitHub仓库创建CocoaPod [英] Creating CocoaPod for existing GitHub repo

查看:174
本文介绍了为现有的GitHub仓库创建CocoaPod的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我创建了一个小型的iOS类,我想用它与CocoaPods。现在我已将它添加到 GitHub ,并且我遵循本教程解释了创建CocoaPod的过程,但我一直坚持使用这个:将Podspec添加到CocoaPods规格声明 。

有人可以解释以下步骤,例如如何分叉存储库并发出拉取请求。
我知道Google上有很多类似的答案,但如果有人能够分享创建CocoaPods的经验,我会非常感激。



在我将项目添加到项目中之前,我还有一个选项可用于检查最终结果是什么?

解决方案

现在您需要使用 Trunk 上传你的规格。首先,确保你已经注册了一个与Trunk的会话:

  pod trunk register [email] [name] --description = [your会话描述] 




  1. pod spec create

  2. 编辑 SuperAwesomeProject.podspec 文件并保存。 Podspec语法指南

  3. 运行 pod spec lint 并修复它报告的任何错误。 使用部署podspec> pod trunk push SuperAwesomeProject.podspec


  4. 比下面的老方法简单得多!



    注意:下面显示的信息已过期。






    不要做这件事。我只是把它留在这里作为后代。


    1. 访问 CocoaPods规格回购

    2. 使用终端克隆您的repo git clone git@github.com:github-username / Specs.git
    3. code>
    4. cd规格&& mkdir -p project-name / version-number 例如 mkdir -p SuperAwesomeProject / 0.0.1

    5. cd SuperAwesomeProject / 0.0.1

    6. pod spec创建

    7. 编辑 SuperAwesomeProject.podspec 文件并保存。 Podspec语法指南

    8. 运行 pod spec lint 并修复它报告的任何错误。 如果您的规范通过了linting,请将您的podspec添加为 git commit -am 添加SuperAwesomeProject

    9. git push origin master
    10. 访问您的GitHub分支页面并提交合并请求
    11. 等待其中一个规范所有者合并您的请求。

    如果您已经有了podspec文件,它进入 SuperAwesomeProject / 0.0.1 文件夹并跳过第7步。


    Recently I've created small iOS class and I would like to use it with CocoaPods. By now I have added it to the GitHub and I have followed this tutorial which explains the process of creating CocoaPod but I have stuck with this one: "Adding the Podspec to the CocoaPods Specs Repo".

    Can someone explain following steps, like how to fork the repository and issue a pull request. I know there are a lot of similar answers on Google but I would be very appreciative if someone can share it's experience with creating CocoaPods.

    Also is there an option for checking what will be final result when I add pod to my project before I make it public?

    解决方案

    You now need to use Trunk to upload your spec. Firstly, ensure you have registered a session with Trunk:

    pod trunk register [email] [name] --description=[your session description]
    

    1. pod spec create
    2. Edit the SuperAwesomeProject.podspec file and save. Podspec Syntax Guide
    3. Run pod spec lint and fix any errors it reports.
    4. Deploy your podspec with pod trunk push SuperAwesomeProject.podspec

    Much simpler than the old method below!

    Note: The information posted below is now outdated.


    DO NOT DO THIS. I'm just leaving it here for posterity..

    1. Visit CocoaPods Specs Repo
    2. Press Fork and choose your GitHub account.
    3. Clone your repo using Terminal git clone git@github.com:github-username/Specs.git
    4. cd Specs && mkdir -p project-name/version-number e.g. mkdir -p SuperAwesomeProject/0.0.1
    5. cd SuperAwesomeProject/0.0.1
    6. pod spec create
    7. Edit the SuperAwesomeProject.podspec file and save. Podspec Syntax Guide
    8. Run pod spec lint and fix any errors it reports.
    9. If your spec passes linting, add your podspec with git commit -am "Added SuperAwesomeProject"
    10. git push origin master
    11. Visit your GitHub fork page and submit a Pull Request
    12. Wait for one of the Spec owners to merge your pull request.

    If you already have a podspec file, just copy it into the SuperAwesomeProject/0.0.1 folder and skip step 7.

    这篇关于为现有的GitHub仓库创建CocoaPod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆