Sha256: 89480c2aab98204eb57006fdba272c127f09a3cbc01c7d7c1b5e27a87d28d28c

Contents?: true

Size: 1.95 KB

Versions: 1

Compression:

Stored size: 1.95 KB

Contents

# !/usr/bin/env ruby
require 'cocoapods-project-hmap/xcconfig'
require 'cocoapods-project-hmap/hmap_generator'

module Pod
  class PodTarget
    def reset_header_search_with_relative_hmap_path(hmap_path)
      if build_settings.instance_of?(Hash)
        build_settings.each do |config_name, setting|
          config_file = setting.xcconfig
          config_file.reset_header_search_with_relative_hmap_path(hmap_path)
          # https://github.com/CocoaPods/CocoaPods/issues/1216
          # just turn off private xcconfig's USE_HEADERMAP flag
          config_file.set_use_hmap(false)
          config_path = xcconfig_path(config_name)
          config_file.save_as(config_path)
        end
      elsif build_settings.instance_of?(BuildSettings::PodTargetSettings)
        config_file = build_settings.xcconfig
        config_file.reset_header_search_with_relative_hmap_path(hmap_path)
        # https://github.com/CocoaPods/CocoaPods/issues/1216
        # just turn off private xcconfig's USE_HEADERMAP flag
        config_file.set_use_hmap(false)
        config_path = xcconfig_path
        config_file.save_as(config_path)
      else
        puts 'Unknown build settings'.red
      end
    end
    def recursively_add_dependent_headers_to_hmap(hmap, generate_type)
      dependent_targets.each do |depend_target|
        # set public header for dependent target
        hmap.add_hmap_with_header_mapping(depend_target.public_header_mappings_by_file_accessor, generate_type, depend_target.name, depend_target.product_module_name)
        depend_target.recursively_add_dependent_headers_to_hmap(hmap, generate_type)
      end
    end
  end
  class AggregateTarget
    def reset_header_search_with_relative_hmap_path(hmap_path)
      # override xcconfig
      xcconfigs.each do |config_name, config_file|
        config_file.reset_header_search_with_relative_hmap_path(hmap_path)
        config_path = xcconfig_path(config_name)
        config_file.save_as(config_path)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cocoapods-project-hmap-0.0.4 lib/cocoapods-project-hmap/pod_target.rb