当前位置:网站首页>② 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
边栏推荐
- Install and run mongodb under win10
- Thinkphp6 solving jump problems
- Composer by installation laravel
- Small problems in the spoole framework for TCP communication in PHP
- Reinstallation of cadence16.3, failure and success
- dolphinscheduler海豚调度升级代码改造-UpgradeDolphinScheduler
- centos7部署docker,安装mysql
- Transformers中的动态学习率
- 【图论】—— 二分图
- VGg Chinese herbal medicine identification
猜你喜欢

Abnova abcb10 (human) recombinant protein specification

Metadata management Apache Atlas Compilation (embedded) deployment and various error records encountered

元数据管理Apache Atlas编译(内嵌式)部署及遇到各种错误记录

聊聊 C# 中的 Composite 模式

The solution to prompt "this list creation could be rewritten as a list literal" when adding elements to the list using the append() method in pychart

Go learning record II (window)

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

美团好文:从预编译的角度理解Swift与Objective-C及混编机制

微信小程序:老年祝福短视频

Magnetoresistive saturation
随机推荐
E45: ‘readonly‘ option is set (add ! to override)
《微信小程序-基础篇》带你了解小程序的路由系统(二)
ICer技能03Design Compile
Abnova acid phosphatase (wheat germ) instructions
Shadertoy basic teaching 02. Drawing smiling faces
apache atlas 快速入门
AlertManager告警的单独使用及prometheus配置告警规则使用
The solution to prompt "this list creation could be rewritten as a list literal" when adding elements to the list using the append() method in pychart
Thinkphp6 template replacement
Freemodbus parsing 1
centos7部署docker,安装mysql
微信小程序:未来老婆查询生成器
Pads and flash symbols in cadence
rtklib2.4.3 b34 单点定位的一个bug
Current relay jdl-1002a
Cve-2019-14287 (sudo right raising)
Gson typeadapter adapter
Actual combat | multiple intranet penetration through Viper
Go learning record II (window)
Magnetoresistive saturation