iOS组件化:podspec文件配置指南

官方:Podspec Syntax Reference


#
# Be sure to run `pod lib lint MXStatService.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name             = 'MXStatService'
  s.version          = '8.1.0.0'
  s.summary          = 'MXStatService is MetaApp Stat Framework.'
  s.description      = <<-DESC
TODO: Add long description of the pod here.
                       DESC
  # 项目主页
  s.homepage         = 'http://gitlab.appshahe.com/product/MXStatService.git'
  s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  # license
  s.license          = {
    
     :type => 'MIT', :file => 'LICENSE' }
  # 作者信息
  s.author           = {
    
     'liuyongjie' => '[email protected]' }
  # 资源拉取位置路径 | tag | branch
  s.source           = {
    
     :git => 'http://gitlab.appshahe.com/product/MXStatService.git', :tag => s.version.to_s }
  s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
  # target支持最低版本
  s.ios.deployment_target = '8.0'
  s.source_files = 'MXStatService/Classes/**/*'
  # 公共头文件导进组件.pch文件中,加入后,执行pod install, MXStatService-prefix.pch 文件中就有这些头文件
  s.prefix_header_contents = <<-EOS
  #import <MXMacro/MXMacro.h>
  #import <Masonry/Masonry.h>
  #import <MXCategory/MXCategory.h>
  #import <YYImage/YYAnimatedImageView.h>
  #import <YYModel/YYModel.h>
  #import <YYText/YYText.h>
  EOS
  # 依赖的图片资源bundle
  s.resource_bundles = {
    
    
    'MXStatService' => ['MXStatService/Assets/**/*']
  }
  
  # ************** 依赖库相关 *****************
  # 依赖系统Frameworks
  s.frameworks = 'Foundation', 'UIKit', 'JavaScriptCore', 'WebKit', 'CoreFoundation', 'CoreTelephony', 'Security', 'SystemConfiguration', 'AdSupport', 'CoreMotion'
  # 依赖系统动态.tdb
  s.libraries = 'z', 'sqlite3', 'c++'
  # 依赖第三方.framework,这里的Frameworks文件夹与.podspec文件同级
  s.vendored_frameworks = 'Frameworks/*.framework'
  # 依赖第三方.a静态库,这里的Frameworks文件夹与.podspec文件同级
  s.vendored_libraries = 'Frameworks/*.a'
  # cocopods单个依赖及多个依赖
  s.dependency 'AFNetworking', '3.2.0'
  s.dependency 'YYModel'
  
  # other links flags | bitcode
  s.xcconfig = {
    
     "OTHER_LDFLAGS" => "-ObjC", "ENABLE_BITCODE" => "NO"}

end







猜你喜欢

转载自blog.csdn.net/Yj_sail/article/details/104513348
今日推荐