Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating CocoaPod for existing GitHub repo

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?

like image 812
Josip B. Avatar asked Mar 25 '14 10:03

Josip B.


People also ask

How do I create a Podspec file?

To create a Podspec, navigate to your project file in the Terminal. Run the following command to create the file: touch FantasticView. podspec . Now open the file using an editor.


2 Answers

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 [email protected]: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.

like image 95
squarefrog Avatar answered Sep 22 '22 19:09

squarefrog


Perhaps, my answer is too late... Anyway, please find below steps that I've performed:

  1. pod trunk register YOUR_EMAIL 'YOUR_NAME' --description='YOUR_MAC'
  2. pod spec create YOUR_LIBRARY YOUR_GITHUB_LIBRARY_URL
  3. edit YOUR_LIBRARY.podspec
  4. pod spec lint
  5. pod trunk push YOUR_LIBRARY.podspec
like image 42
Luiz Durães - PSM - MBA Avatar answered Sep 25 '22 19:09

Luiz Durães - PSM - MBA