Class: Pod::PodTarget

Inherits:
Object
  • Object
show all
Defined in:
lib/swordfish/hmap/pod_target.rb,
lib/swordfish/native/target_architectures.rb

Instance Method Summary collapse

Instance Method Details

#generate_hmap(hmap, generate_type, only_public_headers = true, add_dependency = false) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/swordfish/hmap/pod_target.rb', line 67

def generate_hmap(hmap, generate_type, only_public_headers=true, add_dependency=false)
  # There is no need to add headers of target defines module to hmap.
  unless defines_module?
    unless $hmap_black_pod_list.include?(name)
      add_prebuilt_hmap_target(name)
      # Create hmap for current target if not in black list.
      hmap.add_hmap_with_header_mapping(only_public_headers ? public_header_mappings_by_file_accessor : header_mappings_by_file_accessor, generate_type, name, product_module_name)
      # Recursively add dependent targets if needed.
      recursively_add_dependent_headers_to_hmap(hmap, generate_type) if add_dependency
    else
      Pod::UI.message "- skip target in black list :#{name}"
    end
  end
end

#loop_set_archs(is_arm64) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/swordfish/native/target_architectures.rb', line 15

def loop_set_archs(is_arm64)
  build_settings.each do |config_name, setting|
    config_file = setting.xcconfig
    if is_arm64
      config_file.set_archs_arm64
    else
      config_file.set_archs_default
    end
    config_path = xcconfig_path(config_name)
    config_file.save_as(config_path)
  end
end

#recursively_add_dependent_headers_to_hmap(hmap, generate_type) ⇒ Object



59
60
61
62
63
64
65
# File 'lib/swordfish/hmap/pod_target.rb', line 59

def recursively_add_dependent_headers_to_hmap(hmap, generate_type)
  dependent_targets.each do |depend_target|
    # set public header for dependent target
    depend_target.generate_hmap(hmap, generate_type, true, true) if depend_target.respond_to?(:generate_hmap)
    concat_prebuilt_hmap_targets(depend_target.prebuilt_hmap_target_names) if depend_target.prebuilt_hmap_target_names
  end
end

#reset_header_search_with_relative_hmap_path(hmap_path) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/swordfish/hmap/pod_target.rb', line 36

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, @prebuilt_hmap_target_names.uniq)
      # 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, @prebuilt_hmap_target_names.uniq)
    # 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
    Pod::UI.notice 'Unknown build settings'
  end
end