Add cocoapods support for uploading GitHub code

Source: Internet
Author: User

StartHere I'll start with an introduction, including a project on GitHub that has been uploaded to the final support Cocoapods. The steps are as follows:
    • Code upload GitHub
    • Create a Podspec file and verify that the
    • Create release version on GitHub
    • Register Cocoapods Account
    • Upload code to Cocoapods
    • Check if the upload was successful
1 Code upload GitHub First we open the github.com and then create our own project project:

Note The MIT License here, which will be used when adding cocoapods support later (described later). then click Create. Then use the Soucetree code down to the local, put their own items inside, folder:

The license here is the one that just said MIT license added. Kg_gcdtimerdemo is an example project, Kg_gcdtimer is a library that is available to others and then submitted to GitHub. 2 Create Podspec file we use the terminal to the project directory:

Here Kg_gcdtimer is the name of the pod-added city (for example, Mbprogresshud). Results after execution:

In this case, there will be one more Kggcdtimer.podspec file under the project folder. Here I opened with sublime text and made the following edits:

Next, execute the following command to verify:

qiyankundemacbook-pro:kg qiyankun$ pod Lib lint kg_gcdtimer.podspec

When you see Kggcdtimer passed validation, it means the validation passed.


3 Create release version on GitHub

Click Publish Release. After the creation is complete:

4 Register cocoapods account execute command line:
Pod Trunk Register email address ' user name '-description= ' description information '
Open the link in the message so that the Cocoapods account is registered successfully.

can be used
Pod Trunk Me

Check whether the creation was successful.

5 Uploading code to Cocoapods

Check the validity of the file format first:
Pod Spec Lint

Warnings can be ignored using-allow-warnings.

The appearance of passed validation proves that it has been verified. Then execute:
Pod Trunk Push Xxx.podspec-allow-warnings

Wait for the last success

6 Check if the upload was used successfully
Pod Search XXX

Reference Document://Execute POD spec lint error brocade set 0, HTTP://WWW.JIANSHU.COM/P/283584683B0B//1, http://www.cnblogs.com/zhanggui/p/6003481. HTML2, HTTP://WWW.COCOACHINA.COM/IOS/20160415/15939.HTML3, HTTP://WWW.COCOACHINA.COM/IOS/20160907/17501.HTML4, https://cocoapods.org/

Add cocoapods support for uploading GitHub code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.