美文网首页
Flutter编写IOS插件podspec文件说明

Flutter编写IOS插件podspec文件说明

作者: 读书人heart | 来源:发表于2023-10-25 16:30 被阅读0次

字段说明


s.name         = "LivePods" #工程的名字
s.version      = "0.0.1"  #工程的版本
s.summary      = "Live Pods's summary"  #工程的摘要
s.description  = "Live Pods's description"  #工程的描述
s.homepage     = "https://github.com/jifengs/LivePods"  #工程的首页
s.license      = "MIT"  #工程的证书
s.author       = { "xxx" => "xxx@126.com" } #工程的作者
s.ios.deployment_target = "10.0"  #工程的编译版本
s.source       = { :git => "https://github.com/jifengs/LivePods.git", :tag => "#{s.version}" }  #工程的git地址
s.source_files  = "Classes", "Classes/**/*.{h,m}"  #工程需要引入的文件
s.exclude_files = "Classes/Exclude"  #工程不需要引入的文件
s.public_header_files = "Classes/**/*.h"  #工程需要暴露出来的头文件
s.resources = "Resources/*"  #工程需要引入的资源文件(图片,xib等)
s.resource_bundles = {'Resources' => 'XXX.framework/Resources/XXX.bundle'} #工程需要引入的bundle
s.frameworks = "ImageIO"  #工程依赖的framework
s.vendored_frameworks = [] #工程依赖的第三方framework
s.libraries = "iconv", "xml2"  #工程依赖的library
s.vendored_libraries = []  #工程依赖第三方的library
s.requires_arc = true  #工程是否用arc规则
s.dependency "AFNetworking", "~> 4.0.1"  #工程依赖的第三方库

案例:

#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint rtk_ota_plugin.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
  s.name             = 'rtk_ota_plugin'
  s.version          = '1.0.3'
  s.summary          = 'A new Flutter plugin project.'
  s.description      = <<-DESC
A new Flutter plugin project.
                       DESC
  s.homepage         = 'http://example.com'
  s.license          = { :file => '../LICENSE' }
  s.author           = { 'Your Company' => 'email@example.com' }
  s.source           = { :path => '.' }
  # class文件路径
  s.source_files = 'Classes/*'
  # 头文件路径
  s.public_header_files = 'Classes/*.h'
  # 添加framework文件路径
  s.ios.vendored_frameworks = ['Framework/RTKAudioConnectSDK.framework','Framework/RTKLEFoundation.framework','Framework/RTKOTASDK.framework']
  # 添加framework文件
  s.vendored_frameworks = ['RTKAudioConnectSDK.framework','RTKLEFoundation.framework','RTKOTASDK.framework']
  s.dependency 'Flutter'
  # 要pod进去的原生库(可多条)
  s.dependency 'SSZipArchive'
  s.platform = :ios, '9.0'

  # Flutter.framework does not contain a i386 slice.
  s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
end

相关文章

网友评论

      本文标题:Flutter编写IOS插件podspec文件说明

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