一些常用信息介绍:
name:框架名
version:当前版本(注意,是当前版本,假如你后续更新了新版本,需要修改此处)
summary:简要描述,在pod search ZCPKit的时候会显示该信息。
description:详细描述
homepage:页面链接
license:开源协议
author:作者
source:源码git地址
platform:支持最低ios版本
source_files:源文件(可以包含.h和.m)
public_header_files:头文件(.h文件)
resources:资源文件(配置的文件都会被放到mainBundle中)
resource_bundles:资源文件(配置的文件会放到你自己指定的bundle中)
frameworks:依赖的系统框架
vendored_frameworks:依赖的非系统框架
libraries:依赖的系统库
vendored_libraries:依赖的非系统的静态库
dependency:依赖的三方库
具体使用呢!写个 Demo吧,核心内容如下:
Pod::Spec.new do |s|
#项目信息
s.name = "TestLibDemo"#名字
s.version = "1.0.0"#版本号
s.summary = "测试项目"
#描述
s.description = 'This library is testLib ' \
'This library is testLib ' \
'This library is testLib '
#首页
s.homepage = "https://gitee.com/zhengjunjie"
#截屏地址
s.screenshots = "https://github.com/zhengjunjie11/TestLibDemo/blob/master/test.png?raw=true"
#开源协议
s.license = { :type => 'MIT', :file => 'LICENSE' }
#作者信息
s.author = { "天空吸引我" => "2028002516@qq.com" }
# Or just: s.author = "天空吸引我"
# s.authors = { "天空吸引我" => "2028002516@qq.com" }
s.social_media_url = "https://www.jianshu.com/u/0b735abc7135"#社交媒体网址
#平台细节
s.ios.deployment_target = '8.0'
#资源地址
s.source = { :git => "https://github.com/zhengjunjie11/TestLibDemo.git", :tag => s.version.to_s }
#源代码
# s.source_files = "Home/Model/*.{h,m}"
#s.exclude_files = "Classes/Exclude"#排除文件
#s.public_header_files = "Home/Model/*.h"
#资源
# s.resource = "icon.png"#资源
s.resources = "Home/Resoures/*.png"
# s.preserve_paths = "FilesToSave", "MoreFilesToSave"#路径
#系统库使用
# s.framework = "SomeFramework"
s.frameworks = "Accounts","AddressBook"
# s.library = "iconv"
#注意去掉"lib"
s.libraries = 'c++', 'sqlite3', 'stdc++.6.0.9', 'z'
#依赖的非系统的静态库
s.vendored_libraries = 'Home/Lib/*.a'
#依赖的非系统框架
s.vendored_frameworks = 'Home/Frameworks/*.framework'
#s.preserve_paths = "Home/Frameworks/*.framework"
#第三方库使用
s.dependency 'SDWebImage'
s.ios.deployment_target = '8.0'
#文件夹
s.subspec 'Model' do |model|
model.source_files = 'Home/Model/*.{h,m}'
end
s.subspec 'View' do |view|
view.source_files = 'Home/View/*.{h,m}'
end
s.subspec 'VC' do |vc|
vc.source_files = 'Home/VC/*.{h,m}'
end
#配置xcode
s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/Home/Frameworks" }
end
网友评论