美文网首页
iOS 项目模块化 podspec 文件编写

iOS 项目模块化 podspec 文件编写

作者: 夏天然后 | 来源:发表于2022-03-29 18:41 被阅读0次
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' => 'summerxx@xxx.cn' }
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 <DJFoundation/DJFoundation.h>',
'#import <Mantle/Mantle.h>',
'#import <Masonry/Masonry.h>',
'#import <ReactiveObjC/ReactiveObjC.h>',
'#import <DJUIKit/DJUIKit.h>',
'#import <DJResource/DJResource.h>'


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 文件编写

      本文链接:https://www.haomeiwen.com/subject/shkbjrtx.html