iOS 模块化 podspec 文件编写

本文详细介绍了一个名为DJLogin的iOS登录组件的CocoaPods配置过程及依赖管理方案,包括核心功能模块划分、资源文件配置及外部依赖库集成。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值