12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
# File 'lib/cocoapods-kz/native/target_installer_helper.rb', line 12
def update_changed_file(generator, path)
unless KZ::KZGlobalHelper.instance.kz_pod_enable
origin_update_changed_file(generator, path)
return
end
if generator.is_a?(Pod::Target::BuildSettings::AggregateTargetSettings)
unless self.target.application_extension_api_only
xcconfig = generator.xcconfig
kz_clean_xcconfig(xcconfig)
main_hamp_search_path = '"' + KZ::KZ_POD_CONFIG_ROOT_STR + "/#{self.target.user_project.root_object.display_name}.hmap" + '"'
pod_targets = self.target.pod_targets_for_build_configuration(generator.configuration_name)
swift_lldb_ast_paths = []
on_demand_resources_config_paths = []
pod_targets.each do |native_pod_target|
kz_pod_target = native_pod_target.weakRef_kz_pod_target
if kz_pod_target
if kz_pod_target.
main_hamp_search_path += (' ' + KZ.deal_path_for_xcconfig(kz_pod_target., true))
end
add_repair_modulemap(xcconfig, kz_pod_target.all_repair_modulemap_paths, self.target.uses_swift?)
add_repair_swift_include_path(xcconfig, kz_pod_target.all_repair_swift_include_paths, self.target.uses_swift?)
if kz_pod_target.force_load
kz_add_force_load_tag(xcconfig, kz_pod_target)
end
ast_path = kz_pod_target.get_swift_lldb_ast_path
if !ast_path.nil? and generator.configuration_name == "Debug"
swift_lldb_ast_paths << ast_path
end
unless kz_pod_target.on_demand_resources_config_path.nil?
on_demand_resources_config_paths << (kz_pod_target.name + ":" + kz_pod_target.on_demand_resources_config_path)
end
end
end
kz_add_swift_lldb_ast_paths(xcconfig, swift_lldb_ast_paths)
xcconfig.attributes['HEADER_SEARCH_PATHS'] = main_hamp_search_path
xcconfig.attributes['USE_HEADERMAP'] = 'NO'
xcconfig.attributes["KZ_POD_CONFIG_ROOT"] = KZ::KZ_POD_CONFIG_ROOT_STR
if KZ::KZGlobalHelper.instance.arm64_simulator
xcconfig.attributes.delete("EXCLUDED_ARCHS[sdk=iphonesimulator*]")
xcconfig.attributes['VALID_ARCHS'] = 'arm64 arm64_32 x86_64'
end
if KZ::KZGlobalHelper.instance.on_demand_resources_info.odr_target_names.include?(self.target.name.sub('Pods-', ''))
xcconfig.attributes["ENABLE_ON_DEMAND_RESOURCES"] = "NO"
on_demadn_resources_paths = ""
on_demand_resources_config_paths.each do |path|
on_demadn_resources_paths += ((on_demadn_resources_paths.empty? ? '' : ' ') + '"' + path + '"')
end
xcconfig.attributes["KZ_ON_DEMAND_RESOURCES_PATHS"] = on_demadn_resources_paths unless on_demadn_resources_paths.empty?
end
kz_update_xcconfig_file(xcconfig, path)
return
end
elsif generator.is_a?(Pod::Target::BuildSettings::PodTargetSettings)
kz_pod_target = self.target.weakRef_kz_pod_target
if kz_pod_target
xcconfig = generator.xcconfig
custom_paths = []
= xcconfig.attributes['HEADER_SEARCH_PATHS'].split(" ")
unless .nil? || .empty?
.each do |origin_search_paht|
if origin_search_paht.include?("PODS_XCFRAMEWORKS_BUILD_DIR")
custom_paths.append(origin_search_paht)
end
end
end
= generator.pod_target_xcconfig_values_by_consumer_by_key["HEADER_SEARCH_PATHS"]
unless .nil? || .values.empty?
custom_paths.concat(.values)
end
xcconfig.attributes['HEADER_SEARCH_PATHS'] = kz_pod_target.(custom_paths)
xcconfig.attributes['USE_HEADERMAP'] = 'NO'
framework_cache_path = KZ.deal_path_for_xcconfig(kz_pod_target.pod_config_cache_path(true))
xcconfig.attributes['KZ_FRAMEWORK_CACHE_PATH'] = framework_cache_path
if kz_pod_target.force_load
xcconfig.attributes['KZ_FIX_FORCE_LOAD_EXE_FOLDER'] = kz_pod_target.configuration_build_dir(true)
end
if KZ::KZGlobalHelper.instance.arm64_simulator
xcconfig.attributes.delete("EXCLUDED_ARCHS[sdk=iphonesimulator*]")
xcconfig.attributes['VALID_ARCHS'] = 'arm64 arm64_32 x86_64'
end
unless kz_pod_target.custom_origin_yaml_path.nil?
xcconfig.attributes['KZ_CUSTOM_ORIGIN_YAML_PATH'] = KZ.deal_path_for_xcconfig(kz_pod_target.custom_origin_yaml_path)
xcconfig.attributes['KZ_CUSTOM_YAML_PATH'] = KZ.deal_path_for_xcconfig(kz_pod_target.custom_yaml_path)
other_cflags = xcconfig.attributes['OTHER_CFLAGS']
if other_cflags == nil
other_cflags = ""
elsif !other_cflags.end_with?(" ")
other_cflags += " "
end
other_cflags += ("-ivfsoverlay #{KZ.deal_path_for_xcconfig(kz_pod_target.custom_yaml_path, true)}")
xcconfig.attributes['OTHER_CFLAGS'] = other_cflags
other_cplusplusflags = xcconfig.attributes['OTHER_CPLUSPLUSFLAGS']
if other_cplusplusflags == nil
other_cplusplusflags = ""
elsif !other_cplusplusflags.end_with?(" ")
other_cplusplusflags += " "
end
other_cplusplusflags += ("-ivfsoverlay #{KZ.deal_path_for_xcconfig(kz_pod_target.custom_yaml_path, true)}")
xcconfig.attributes['OTHER_CPLUSPLUSFLAGS'] = other_cplusplusflags
other_swift_flags = xcconfig.attributes['OTHER_SWIFT_FLAGS']
if other_swift_flags == nil
other_swift_flags = ""
elsif !other_swift_flags.end_with?(" ")
other_swift_flags += " "
end
other_swift_flags += ("-Xcc -ivfsoverlay -Xcc #{KZ.deal_path_for_xcconfig(kz_pod_target.custom_yaml_path, true)}")
xcconfig.attributes['OTHER_SWIFT_FLAGS'] = other_swift_flags
end
add_repair_modulemap(xcconfig, kz_pod_target.all_repair_modulemap_paths, kz_pod_target.current_uses_swift?)
add_repair_swift_include_path(xcconfig, kz_pod_target.all_repair_swift_include_paths, kz_pod_target.current_uses_swift?)
kz_update_xcconfig_file(xcconfig, path)
return
end
end
origin_update_changed_file(generator, path)
end
|