什么是PodSpecs?

什么是PodSpecs?

A Podspec, or Spec, describes a version of a Pod library. One Pod, over the course of time, will have many Specs. It includes details about where the source should be fetched from, what files to use, the build settings to apply, and other general metadata such as its name, version, and description.

PodSpecs用于描述Pod库的版本。一个Pod随着时间的推移,会产生很多的规范。比如说:源的获取位置、它用到了哪些文件、它的构建的设置,以及其他常规元数据,如其名称,版本和描述。

事实上PodSpec就是对Pod以上这些信息的记录与描述

在 k8s 中,kubelet 接收一组通过各类机制提供给它的 PodSpecs,确保这些 PodSpecs 中描述的容器处于运行状态且健康。

How to use?

这里展示一个使用示例

Pod::Spec.new do |spec|
  spec.name             = 'Reachability' #名字
  spec.version          = '3.1.0'	#版本
  spec.license          = { :type => 'BSD' }	#证书
  spec.homepage         = 'https://github.com/tonymillion/Reachability'	#首页
  spec.authors          = { 'Tony Million' => 'tonymillion@gmail.com' }	#作者
  spec.summary          = 'ARC and GCD Compatible Reachability Class for iOS and macOS.'	#摘要
  spec.source           = { :git => 'https://github.com/tonymillion/Reachability.git', :tag => 'v3.1.0' }	#它的源地址
  spec.source_files     = 'Reachability.h,m'	#要引入的文件
  spec.framework        = 'SystemConfiguration'	#依赖的框架
  spec.requires_arc     = true	#是否使用arc规则
end
posted @ 2022-01-23 12:03  Mrxuexi  阅读(274)  评论(0编辑  收藏  举报