How to Create a CocoaPods public database for iOS, ioscocoapods
Introduction
In the development process, the third framework is often used.pod install
Command 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 install
How can I install my own framework using commands? Next, I will teach you how to add your ownpods
PublishCocoaPods
. If youCocoaPods
I 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
CreateCocoaPods
Share 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,GitHub
The repository name. duplicate names are not allowed.
2. Open-source protocols are generally selectedMIT
.
2. Use command line,sourceTree
OrGitHub Mac
Clone 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.podspec
The name of the created public database.
WhenSpecification created at MYSementManager.podspec
The public database is successfully created.
4. Use a text editor orsublime
Edit 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.push
Togithub
.
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 beforepush
Upload once) or directlygithub
Clickrelease
Createrelease
Add the public warehousetag
.
$ Git tag-m "first release" 0.0.1 $ git push -- tags # push tag to remote Repository
VII. Registrationtrunk
For example:
Pod trunk register mailbox 'username' -- description = 'description'
Note:
Email isgithub
The 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.