当前位置:网站首页>② Cocoapods principle and podspec file uploading operation
② Cocoapods principle and podspec file uploading operation
2022-06-23 05:06:00 【Black code brother】
cocoapods principle
Gem It's a management Ruby Standard packages for libraries and programs , It passes through Ruby Gem( Such as http://rubygems.org/ ) Source 、 install 、 Upgrade and uninstall packages , It's very convenient .
Can pass pod --versionn see pod Version number
Can pass ruby -v see ruby Version number
Can pass gem -v see gem Version number
pod Basic operation
- View the third-party framework repository source
pod repo - Remove warehouse source
pod repo remove master - Add warehouse source
pod repo add master http://git.oschina.net/akuandev/Specs.git - initialization ( Download all the third-party framework information in the server , Cache to local computer )
pod setup pod searchFramework keywords — Cached from local " Third party framework description information " Retrieved... From the generated retrieval file Information about the relevant framework- Delete cocoapods Index file
rm ~/Library/Caches/CocoaPods/search_index.json - establish Podfile file , Go into your own project ( First level directory )
- Podfile The function of documents ?
answer : It's really just using ruby Grammatically written “ The framework depends on the description file ”; Just tell cocoapods Which frameworks need to be downloaded and integrated - Create command
pod init
- Podfile The function of documents ?
- Install the frame
pod install

cocoapods Schematic diagram :
sepcs
Remote index library
`pod setup``
In fact, it is to download the remote index library to the local index library
If we pod install after , Then download the three parties to the project .
When we use these source codes again in another project , then install after , It will be soon , Because a local backup has been made
When we first pod search It's going to be slow , Because it will be downloaded again , Then put it in the cache , So it will be much faster to perform this operation next time . The following figure shows the cache path 

Create a remote library , And make PodSpec adopt trunk push podspec file
First step , Upload items to github, And label it
- See my first componentization article for specific operations git Basic use
git push origin mastergit tag '1.0.0'git push --tags
The second step , register trunk
pod trunk register 157******[email protected] 'wanggang' --verbose
–verbose Parameter is used to output debugging information during registration- After registration, the email will be sent to you , Go in and check .
The third step , Configure and upload the framework PodSpec file
principle
- PodSpec file Describe your framework information : author , edition , Download address, etc
- pod search Search framework , It is based on the information in this
- Be careful : Generally, the name of this file is consistent with the project name
- Create command :
pod spec create File name - I'll do it myself :
$ cd /Users/liuxitong/Desktop/testLib
$ pod spec create testLib
This creates , As shown in the figure :
PodSpec File format
- Can be downloaded by cocoapods Description information in the management framework , You can also check on the official website The website links
- pod spec lint podspec file
- If the check fails , If you find any problems, you can modify them podspec Corresponding place .
- some podspec Field interpretation in :
spec.source_files: Which tag files to get from the address Wildcards denote directories , namely classes Directory in folder
spec.source_files = “Classes”, "Classes//*.{h,m}"
adopt trunk push podspec file
pod trunk push- I'll do it here
pod trunk push testLib.podspec
So we will PodSpec Upload succeeded , And then we were in cocoapod You can also add our new third-party library . - This method is actually uploading the description file to cocoapods stay github In the warehouse above , Warehouse address
- Then you need to wait for the review , Follow pull request equally , The author's consent is required
Step four , Update local pod Third party framework information data source
pod setupStep five , Use pod search Command to search your own frame , If you can search , Then it means that the audit has passed
边栏推荐
- Course design C for freshmen -- clothing management system
- ZK has a node reporting it is possible not running and the log has no obvious error
- 微信小程序:土味情话恋爱话术
- PCB -- bridge between theory and reality
- 微信小程序:拼图工具箱
- A mvc5+easyui enterprise rapid development framework source code BS framework source code
- 元数据管理Apache Atlas编译(内嵌式)部署及遇到各种错误记录
- How to better organize the minimum web api code structure
- Function declaration and call of 17 generator
- Pads and flash symbols in cadence
猜你喜欢

ICER skills 03design compile

怎样利用数据讲一个精彩故事?

微信小程序实例开发:跑起来

Receive incoming files and download (simple usage) a tag

Non return to zero code NRZ

Win10 view my Ini path

The solution to prompt "this dictionary creation could be rewritten as a dictionary literal" when updating the dictionary key value in pychart

微信小程序:土味情话恋爱话术

Abnova blood total nucleic acid purification kit protocol

ApiPost接口测试的用法之------Post
随机推荐
Shadertoy basic teaching 01. Circle drawing (explanation of smoothstep() function)
Wechat applet example development: run
Const understanding II
Talk about the composite pattern in C #
AlertManager告警的单独使用及prometheus配置告警规则使用
QT elidedtext only works for Chinese conformity, but not for English
《微信小程序-基础篇》带你了解小程序的路由系统(二)
Abnova acid phosphatase (wheat germ) instructions
GNSS速度解算的三种方法
ICER skill 02makefile script self running VCs simulation
Abnova abcb10 (human) recombinant protein specification
Welcome to the CSDN markdown editor
轮播图的实现
Flask Foundation: environment setup + configuration + mapping between URL and attempt + redirection + database connection
Object structure diagram, which can quickly illustrate the internal structure of an object
微信小程序:微信也可以发闪照了闪照制作生成微信小程序源码下载,自定义闪照时间
Can bus Basics
Static two position relay xjls-84/440/dc220v
Win10 view my Ini path
teqc进行GNSS数据质量分析时生成的s文件介绍