@@ -30,9 +30,12 @@ def add(name, value, defaults: nil)
3030 include XCConfigResolver
3131
3232 attr_reader :installer , :pod_target , :file_accessors , :non_library_spec , :label , :package , :default_xcconfigs , :resolved_xconfig_by_config , :relative_sandbox_root
33+
34+ # rubocop:disable Style/AccessModifierDeclarations
3335 private :installer , :pod_target , :file_accessors , :non_library_spec , :label , :package , :default_xcconfigs , :resolved_xconfig_by_config , :relative_sandbox_root
36+ # rubocop:enable Style/AccessModifierDeclarations
3437
35- def initialize ( installer , pod_target , non_library_spec = nil , default_xcconfigs = { } , experimental_deps_debug_and_release = false )
38+ def initialize ( installer , pod_target , non_library_spec = nil , default_xcconfigs = { } , experimental_deps_debug_and_release = false , xcframework_excluded_platforms = [ ] )
3639 @installer = installer
3740 @pod_target = pod_target
3841 @file_accessors = non_library_spec ? pod_target . file_accessors . select { |fa | fa . spec == non_library_spec } : pod_target . file_accessors . select { |fa | fa . spec . library_specification? }
@@ -43,6 +46,7 @@ def initialize(installer, pod_target, non_library_spec = nil, default_xcconfigs
4346 @default_xcconfigs = default_xcconfigs
4447 @resolved_xconfig_by_config = { }
4548 @experimental_deps_debug_and_release = experimental_deps_debug_and_release
49+ @xcframework_excluded_platforms = xcframework_excluded_platforms
4650 @relative_sandbox_root = installer . sandbox . root . relative_path_from ( installer . config . installation_root ) . to_s
4751 end
4852
@@ -691,15 +695,20 @@ def vendored_xcframeworks
691695 {
692696 'name' => xcframework . name ,
693697 'slices' => xcframework . slices . map do |slice |
694- {
695- 'identifier' => slice . identifier ,
696- 'platform' => rules_ios_platform_name ( slice . platform ) ,
697- 'platform_variant' => slice . platform_variant . to_s ,
698- 'supported_archs' => slice . supported_archs ,
699- 'path' => slice . path . relative_path_from ( @package_dir ) . to_s ,
700- 'build_type' => { 'linkage' => slice . build_type . linkage . to_s , 'packaging' => slice . build_type . packaging . to_s }
701- }
702- end
698+ platform_name = rules_ios_platform_name ( slice . platform )
699+ if @xcframework_excluded_platforms . include? ( platform_name )
700+ nil
701+ else
702+ {
703+ 'identifier' => slice . identifier ,
704+ 'platform' => platform_name ,
705+ 'platform_variant' => slice . platform_variant . to_s ,
706+ 'supported_archs' => slice . supported_archs ,
707+ 'path' => slice . path . relative_path_from ( @package_dir ) . to_s ,
708+ 'build_type' => { 'linkage' => slice . build_type . linkage . to_s , 'packaging' => slice . build_type . packaging . to_s }
709+ }
710+ end
711+ end . compact
703712 }
704713 end
705714 end
0 commit comments