为现有的GitHub仓库创建CocoaPod [英] Creating CocoaPod for existing GitHub repo
问题描述
最近我创建了一个小型的iOS类,我想用它与CocoaPods。现在我已将它添加到 GitHub ,并且我遵循本教程解释了创建CocoaPod的过程,但我一直坚持使用这个:将Podspec添加到CocoaPods规格声明 。
有人可以解释以下步骤,例如如何分叉存储库并发出拉取请求。
我知道Google上有很多类似的答案,但如果有人能够分享创建CocoaPods的经验,我会非常感激。
在我将项目添加到项目中之前,我还有一个选项可用于检查最终结果是什么?
现在您需要使用 Trunk 上传你的规格。首先,确保你已经注册了一个与Trunk的会话:
pod trunk register [email] [name] --description = [your会话描述]
-
pod spec create
- 编辑
SuperAwesomeProject.podspec
文件并保存。 Podspec语法指南 - 运行
pod spec lint
并修复它报告的任何错误。 使用部署podspec> pod trunk push SuperAwesomeProject.podspec $ c
- 访问 CocoaPods规格回购
- 使用终端
克隆您的repo git clone git@github.com:github-username / Specs.git
code> -
cd规格&& mkdir -p project-name / version-number
例如mkdir -p SuperAwesomeProject / 0.0.1
-
cd SuperAwesomeProject / 0.0.1
-
pod spec创建
- 编辑
SuperAwesomeProject.podspec
文件并保存。 Podspec语法指南 - 运行
pod spec lint
并修复它报告的任何错误。 如果您的规范通过了linting,请将您的podspec添加为git commit -am 添加SuperAwesomeProject
-
git push origin master
访问您的GitHub分支页面并提交合并请求 - 等待其中一个规范所有者合并您的请求。
pod spec create
- Edit the
SuperAwesomeProject.podspec
file and save. Podspec Syntax Guide - Run
pod spec lint
and fix any errors it reports. - Deploy your podspec with
pod trunk push SuperAwesomeProject.podspec
- Visit CocoaPods Specs Repo
- Press Fork and choose your GitHub account.
- Clone your repo using Terminal
git clone git@github.com:github-username/Specs.git
cd Specs && mkdir -p project-name/version-number
e.g.mkdir -p SuperAwesomeProject/0.0.1
cd SuperAwesomeProject/0.0.1
pod spec create
- Edit the
SuperAwesomeProject.podspec
file and save. Podspec Syntax Guide - Run
pod spec lint
and fix any errors it reports. - If your spec passes linting, add your podspec with
git commit -am "Added SuperAwesomeProject"
git push origin master
- Visit your GitHub fork page and submit a Pull Request
- Wait for one of the Spec owners to merge your pull request.
比下面的老方法简单得多!
注意:下面显示的信息已过期。
不要做这件事。我只是把它留在这里作为后代。
如果您已经有了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]
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..
If you already have a podspec file, just copy it into the SuperAwesomeProject/0.0.1
folder and skip step 7.
这篇关于为现有的GitHub仓库创建CocoaPod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!