diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..e70b452 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.6.0 diff --git a/lib/cocoapods/bazel/target.rb b/lib/cocoapods/bazel/target.rb index 11a075c..0bc2369 100644 --- a/lib/cocoapods/bazel/target.rb +++ b/lib/cocoapods/bazel/target.rb @@ -278,13 +278,14 @@ def common_pod_target_infoplists(additional_plist: nil) def to_rule_kwargs kwargs = RuleArgs.new do |args| + private_header_files_array = file_accessors.map(&:spec_consumer).flat_map(&:private_header_files).flat_map { |g| expand_glob(g, expand_directories: false) } args .add(:name, label) .add(:module_name, product_module_name, defaults: [label]) .add(:module_map, !non_library_spec && file_accessors.map(&:module_map).find(&:itself)&.relative_path_from(@package_dir)&.to_s, defaults: [nil, false]). # public headers - add(:public_headers, glob(attr: :public_headers, sorted: false).yield_self { |f| case f when Array then f.reject { |path| path.include? '.framework/' } else f end }, defaults: [[]]) + add(:public_headers, glob(attr: :public_headers, sorted: false, excludes: private_header_files_array).yield_self { |f| case f when Array then f.reject { |path| path.include? '.framework/' } else f end }, defaults: [[]]) .add(:private_headers, glob(attr: :private_headers).yield_self { |f| case f when Array then f.reject { |path| path.include? '.framework/' } else f end }, defaults: [[]]) .add(:pch, glob(attr: :prefix_header, return_files: true).first, defaults: [nil]) .add(:data, glob(attr: :resources, exclude_directories: 0), defaults: [[]]) diff --git a/lib/cocoapods/bazel/xcconfig_resolver.rb b/lib/cocoapods/bazel/xcconfig_resolver.rb index 1383ff6..205a665 100644 --- a/lib/cocoapods/bazel/xcconfig_resolver.rb +++ b/lib/cocoapods/bazel/xcconfig_resolver.rb @@ -8,7 +8,8 @@ module XCConfigResolver def resolved_build_setting_value(setting, settings:) return unless (value = settings[setting]) - sub_prefix = ->(s) { s.sub(%r{\A:/}, '') } + sub_prefix = ->(s) { s.to_s.sub(%r{\A:/}, '') } + resolved = resolve_string_with_build_settings(value, settings: settings) if Pod::Target::BuildSettings::PLURAL_SETTINGS.include?(setting) resolved.shellsplit.reject(&:empty?).map(&sub_prefix)