How to Create a CocoaPods public database for iOS, ioscocoapods

Source: Internet
Author: User
Tags github mac

How to Create a CocoaPods public database for iOS, ioscocoapods
Introduction

In the development process, the third framework is often used.pod installCommand to easily add a third-party framework to our own project.

If we want to open source components or libraries that we write, so that others canpod installHow can I install my own framework using commands? Next, I will teach you how to add your ownpodsPublishCocoaPods. If youCocoaPodsI don't know much about it yet. I suggest you take a look at this article: CocoaPods Installation and Use

Process
1. register the CocoaPods account information. 2. Create a shared library file and upload it to the public repository. 3. edit the file. podspec file 4. tag and release a release version 5. Publish your own database description file podspec to cocoapods6. Search for and use the new database 7. update and maintain podspec

CreateCocoaPodsShare the public database:

1. Create a project on github and copy the link path of the project, for example:Https://github.com/sunjinshuai/MYSementManager;

Note:
1,GitHubThe repository name. duplicate names are not allowed.
2. Open-source protocols are generally selectedMIT.

2. Use command line,sourceTreeOrGitHub MacClone the project to a new local folder;

3. Run cd to enter the local folder, drag your previous project file (demo) and shared file (shared library Lib) into it, and create a public repository, for example:

pod spec create cocoaPodsName;
Note:
1. Your own project file (demo) and shared file (shared library Lib ).
2, MYSementManager.podspecThe name of the created public database.

WhenSpecification created at MYSementManager.podspecThe public database is successfully created.

4. Use a text editor orsublimeEdit the public warehouse information (Note: The quotation marks cannot be incorrect. They are in the English format "", not in the Chinese format ""). The text editor is selected by default.

Note:

1. s. name: name of the public database. 2. s. version: version of the public database. 3. s. summary: A Brief Introduction to the public database. 4. s. description: Detailed description of the public database. 5. s. homepage: Address of the public library on GitHub. 6. s. license: Open Source protocol. 7. s. author: author. 8. s. source: Address and version number of the public library on GitHub. 9. s. source_files:. h and. m Files shared by the Public Library. 10. s. requires_arc: whether ARC is supported.

For fields not involved, go to the official documentation.

5. Edit and save and verify whether the local public warehouse is valid.

pod lib lint cocoaPodsName.podspec

6. Verify that all files in the local folder are valid.pushTogithub.

git add .git commit -m "first commit"git remote add origin https://github.com/sunjinshuai/test.gitgit push -u origin master

Usegit tag(This method is used beforepushUpload once) or directlygithubClickreleaseCreatereleaseAdd the public warehousetag.

$ Git tag-m "first release" 0.0.1 $ git push -- tags # push tag to remote Repository

VII. RegistrationtrunkFor example:

Pod trunk register mailbox 'username' -- description = 'description'

Note:
Email isgithubThe login mailbox and user name on isgithub.

Receive the link sent to your mailbox and click Enter to register successfully.

Author: s _ on the road
Link: https://www.jianshu.com/p/c852ab73ffa0
Source: Simplified book
Copyright belongs to the author. For commercial reprint, please contact the author for authorization. For non-commercial reprint, please indicate the source.

 

Related Article

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.