iOS 项目模块化 podspec 文件编写

Pod::Spec.new do |s|

s.name          = "DJLogin"
s.version       = "0.0.1"
s.summary       = "DJLogin"

s.description   = <<-DESC
A longer description of DJLogin in Markdown format.

* Think: Why did you write this? What is the focus? What does it do?
* CocoaPods will be using this to generate tags, and improve search results.
* Try to keep it short, snappy and to the point.
* Finally, don't worry about the indent, CocoaPods strips it!
DESC

s.homepage      = "https://github.com/DJLogin"
s.author           = { 'summerxx' => '[email protected]' }
s.platform      = :ios, "10.0"
s.source        = { :git => "https://github.com/DJLogin.git", :tag => "0.1.0" }

#s.source_files  = "Classes/**/*.{h,m,swift}"
#s.resource_bundle = {
#  'DJLogin' => ['Resources/*']
#}
s.prefix_header_contents =
'@import DJFoundationSwift;',
'@import DJUIKitSwift;',
'@import DJServices;',
'#import ',
'#import ',
'#import ',
'#import ',
'#import ',
'#import '


s.dependency 'DJFoundation'
s.dependency 'DJUIKit'
s.dependency 'DJServices'
s.dependency 'Mantle'
s.dependency 'Masonry'
s.dependency 'ReactiveObjC'
s.dependency 'DJResource'
s.dependency 'DJApi'
s.dependency 'Networking'
# 默认引用 LivePush
s.default_subspec = 'LivePush' 
# 公用代码
s.subspec 'Core' do |ss|
  ss.source_files  = "Core/**/*.{h,m,swift}"
end
#主 app 引用代码
s.subspec 'DongjiaApp' do |ss|
   ss.source_files  = "DongjiaApp/**/*.{h,m,swift}"
   ss.dependency 'DJLogin/Core'
   ss.dependency 'LBXScan'
   ss.dependency 'DJWebSocket'
   ss.dependency 'JVerification'
end
#推流 app 引用代码
s.subspec 'LivePush' do |ss|
  ss.source_files  = "LivePush/**/*.{h,m,swift}"
  ss.dependency 'DJLogin/Core'
  ss.resource_bundle = {
    'DJLogin' => ['LivePush/Resources/*']
  }
end

end

生成的项目目录如下图


截屏2022-03-29 下午6.44.02.png

注意:
文件路径不能错
每个子模块的子文件单独引用依赖

你可能感兴趣的:(iOS 项目模块化 podspec 文件编写)