1. 配置 .podspec 文件
Pod::Spec.new do |s|
s.name = 'XXX'
s.version = '1.0.0'
s.summary = 'XXX'
s.description = <<-DESC
Xxx Swift Kit
DESC
s.license = { :type => 'MIT', :text => <<-LICENSE
MIT
LICENSE
}
s.homepage = 'https://github.com/xxxxxx/xxx'
s.author = { 'author' => 'emailname@126.com' }
s.source = { :git => 'https://github.com/xxxxxx/xxx.git', :tag => s.version.to_s }
s.ios.deployment_target = '11.0'
s.swift_version = '5.0'
s.frameworks = 'UIKit', 'Foundation', 'AVKit', 'Photos', 'MediaPlayer', 'CoreLocation', 'CoreGraphics'
# 对象
s.subspec 'Object' do |ss|
ss.resource = 'Xxx/Classes/Object/*.xcassets'
ss.source_files = 'Xxx/Classes/Object/*'
end
# 扩展
s.subspec 'Extension' do |ss|
ss.resource = 'Xxx/Classes/Extension/*.xcassets'
ss.source_files = 'Xxx/Classes/Extension/*'
end
end
2. 验证 .podspec 文件
# 本地验证
pod lib lint xxx.podspec
# 远程验证
pod spec lint xxx.podspec
# 远程发布
pod trunk push xxx.podspec
# 查看账号
pod trunk me
# 注册账号
pod trunk register emailname@126.com