TyrantDante / cocoapods-xcframework

MIT License
142 stars 31 forks source link

Build framework for multi-platform. #9

Closed misakatao closed 3 years ago

misakatao commented 3 years ago

编译包含多个平台的 podspec 文件时,最终的 xcframework 产物只有一个平台。 执行命令为:

pod framework TestResourcesPod.podspec --verbose

编译的 podspec 例子:

Pod::Spec.new do |s|
  s.name             = 'TestResourcesPod'
  s.version          = '0.1.0'
  s.summary          = 'A short description of TestResourcesPod.'
  s.homepage         = ''
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.source           = { :git => '', :tag => s.version.to_s }

  s.ios.deployment_target = '9.0'
  s.watchos.deployment_target = '2.0'

  s.source_files = 'TestResourcesPod/Classes/**/*'

  s.resources = 'TestResourcesPod/Assets/*.bundle'

  s.resource_bundles = {
    'TestResourcesPod' => ['TestResourcesPod/Assets/icons/*'],
    'TestResourcesPodImage' => 'TestResourcesPod/Assets/img/*'
  }

  s.frameworks = 'UIKit'
end
TyrantDante commented 3 years ago

显式申明下 platforms 试试看