cocoapods-kz 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cocoapods-kz/command/info.rb +5 -2
- data/lib/cocoapods-kz/command/repair.rb +19 -12
- data/lib/cocoapods-kz/gem_version.rb +1 -1
- data/lib/cocoapods-kz/helpers/kz_analyzer.rb +29 -0
- data/lib/cocoapods-kz/helpers/kz_framework_manager.rb +24 -1
- data/lib/cocoapods-kz/helpers/{kz_generator.rb → kz_generator_hmap.rb} +2 -222
- data/lib/cocoapods-kz/helpers/kz_generator_on_demand_resources.rb +231 -0
- data/lib/cocoapods-kz/helpers/kz_global_helper.rb +38 -8
- data/lib/cocoapods-kz/helpers/kz_pod_target.rb +79 -5
- data/lib/cocoapods-kz/helpers/repair_module_import.rb +1 -1
- data/lib/cocoapods-kz/native/build_configuration.rb +12 -0
- data/lib/cocoapods-kz/native/dls.rb +13 -7
- data/lib/cocoapods-kz/native/file_accessor.rb +25 -5
- data/lib/cocoapods-kz/native/installer.rb +11 -2
- data/lib/cocoapods-kz/native/path_list.rb +11 -0
- data/lib/cocoapods-kz/native/pod_target_installer.rb +0 -20
- data/lib/cocoapods-kz/native/specification.rb +6 -0
- data/lib/cocoapods-kz/native/target_installer_helper.rb +36 -1
- data/lib/cocoapods-kz/native/target_integrator.rb +6 -12
- data/lib/cocoapods-kz/native.rb +2 -0
- data/lib/cocoapods-kz/resources/FlexCompiler_V1 +0 -0
- data/lib/cocoapods-kz/resources/on_demand_resources/kz_on_demand_resources_process.rb +194 -0
- data/lib/cocoapods-kz/resources/on_demand_resources/kz_on_demand_resources_xocde.sh +4 -81
- metadata +8 -7
- data/lib/cocoapods-kz/native/dsl_spec.rb +0 -7
- data/lib/cocoapods-kz/resources/on_demand_resources/kz_complete_asset_pack_output_spec_plist.rb +0 -26
- data/lib/cocoapods-kz/resources/on_demand_resources/kz_create_asset_pack_manifest_plist.rb +0 -44
- data/lib/cocoapods-kz/resources/on_demand_resources/kz_create_on_demand_resources_plis.rb +0 -26
@@ -7,6 +7,21 @@ require_relative 'kz_config_result'
|
|
7
7
|
require_relative 'kz_pod_target'
|
8
8
|
|
9
9
|
module KZ
|
10
|
+
class KZOnDemandResourcesInfo
|
11
|
+
attr_accessor :enable
|
12
|
+
attr_accessor :config_plist_path_patterns
|
13
|
+
attr_accessor :bundle_id
|
14
|
+
attr_accessor :odr_target_name
|
15
|
+
|
16
|
+
def initialize
|
17
|
+
@enable = false
|
18
|
+
@config_plist_path_patterns = {}
|
19
|
+
@bundle_id = ""
|
20
|
+
@odr_target_name = ""
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
10
25
|
KZ_POD_CONFIG_VERSION = '1.0.2'
|
11
26
|
KZ_POD_CONFIG_ROOT = Pod::Config.instance.installation_root + 'Pods/KZPodConfigure'
|
12
27
|
KZ_POD_CONFIG_SUPPORT_FILES = KZ_POD_CONFIG_ROOT + 'SupportFiles'
|
@@ -55,7 +70,7 @@ module KZ
|
|
55
70
|
attr_accessor :generate_kz_pod_targets
|
56
71
|
attr_accessor :debug_shell_log_tag
|
57
72
|
attr_accessor :arm64_simulator
|
58
|
-
attr_accessor :
|
73
|
+
attr_accessor :on_demand_resources_info
|
59
74
|
|
60
75
|
private_class_method :new
|
61
76
|
|
@@ -70,6 +85,7 @@ module KZ
|
|
70
85
|
@olde_lock_file_content = nil
|
71
86
|
@debug_shell_log_tag = "&> /dev/null"
|
72
87
|
@arm64_simulator = false
|
88
|
+
@on_demand_resources_info = KZOnDemandResourcesInfo.new
|
73
89
|
end
|
74
90
|
|
75
91
|
def debug=(value)
|
@@ -96,10 +112,6 @@ module KZ
|
|
96
112
|
FileUtils.rm_rf(KZ_POD_CONFIG_POD_TEMPDIR) if File.exist?(KZ_POD_CONFIG_POD_TEMPDIR)
|
97
113
|
FileUtils.mkdir_p(KZ_POD_CONFIG_POD_TEMPDIR)
|
98
114
|
|
99
|
-
FileUtils.rm(FLEX_COMPLIER_PATH) if File.exist?(FLEX_COMPLIER_PATH)
|
100
|
-
FileUtils.cp_r(File.dirname(__FILE__) + '/../resources/FlexCompiler', FLEX_COMPLIER_PATH)
|
101
|
-
system("chmod +x #{FLEX_COMPLIER_PATH}")
|
102
|
-
|
103
115
|
FileUtils.cp_r(File.dirname(__FILE__) + '/../resources/kz_generator_framework.sh', KZ_GENERATOR_FRAMEWORK_PATH)
|
104
116
|
system("chmod +x #{KZ_GENERATOR_FRAMEWORK_PATH}")
|
105
117
|
|
@@ -116,8 +128,8 @@ module KZ
|
|
116
128
|
|
117
129
|
Pod::Config.instance.podfile.use_frameworks!(:linkage => :static)
|
118
130
|
|
119
|
-
if
|
120
|
-
|
131
|
+
FileUtils.rm_r(KZ_ON_DEMAND_RESOURCES) if File.exist?(KZ_ON_DEMAND_RESOURCES)
|
132
|
+
if on_demand_resources_info.enable
|
121
133
|
FileUtils.cp_r(File.dirname(__FILE__) + '/../resources/on_demand_resources/', KZ_ON_DEMAND_RESOURCES)
|
122
134
|
system("chmod +x #{KZ_ON_DEMAND_RESOURCES_SHELL}")
|
123
135
|
end
|
@@ -127,6 +139,21 @@ module KZ
|
|
127
139
|
end
|
128
140
|
end
|
129
141
|
|
142
|
+
def handle_flexCompiler
|
143
|
+
flexlib_info = @kz_analyzer.pod_of_flexlib_info
|
144
|
+
FileUtils.rm(FLEX_COMPLIER_PATH) if File.exist?(FLEX_COMPLIER_PATH)
|
145
|
+
if flexlib_info.have_flexLib_pod
|
146
|
+
if flexlib_info.flexLib_version.major >= 4
|
147
|
+
FileUtils.cp_r(File.dirname(__FILE__) + '/../resources/FlexCompiler_V1', FLEX_COMPLIER_PATH)
|
148
|
+
else
|
149
|
+
FileUtils.cp_r(File.dirname(__FILE__) + '/../resources/FlexCompiler', FLEX_COMPLIER_PATH)
|
150
|
+
end
|
151
|
+
elsif flexlib_info.have_kzswiftui_pod
|
152
|
+
FileUtils.cp_r(File.dirname(__FILE__) + '/../resources/FlexCompiler_V1', FLEX_COMPLIER_PATH)
|
153
|
+
end
|
154
|
+
system("chmod +x #{FLEX_COMPLIER_PATH}") if File.exist?(FLEX_COMPLIER_PATH)
|
155
|
+
end
|
156
|
+
|
130
157
|
def analyze_special_parameters(use_code_tag, use_framework_tag, pod_names)
|
131
158
|
specify_pod_names = []
|
132
159
|
if pod_names.count > 0
|
@@ -159,10 +186,13 @@ module KZ
|
|
159
186
|
end
|
160
187
|
|
161
188
|
def have_flexLib_pod_target
|
189
|
+
return @kz_analyzer.pod_of_flexlib_info.have_kzswiftui_pod || @kz_analyzer.pod_of_flexlib_info.have_flexLib_pod
|
190
|
+
end
|
191
|
+
|
192
|
+
def check_and_copy_flex_compiler
|
162
193
|
@kz_analyzer.all_kz_pod_targets.values.each do |target|
|
163
194
|
return true if target.root_name == 'FlexLib' || target.root_name == 'KZSwiftUI'
|
164
195
|
end
|
165
|
-
false
|
166
196
|
end
|
167
197
|
|
168
198
|
def write_lock_file
|
@@ -5,6 +5,10 @@ require_relative 'kz_global_helper'
|
|
5
5
|
|
6
6
|
module KZ
|
7
7
|
|
8
|
+
Initial_Install_Tags = "Initial Install Tags"
|
9
|
+
Prefetched_Tag_Order = "Prefetched Tag Order"
|
10
|
+
Download_Only_On_Demand = "Download Only On Demand"
|
11
|
+
|
8
12
|
class KZPodTarget
|
9
13
|
|
10
14
|
attr_reader :native_pod_target
|
@@ -50,6 +54,9 @@ module KZ
|
|
50
54
|
|
51
55
|
attr_accessor :disable_to_simulator_frameworks
|
52
56
|
|
57
|
+
attr_accessor :on_demand_resources_config_patterns
|
58
|
+
attr_accessor :on_demand_resources_config_path
|
59
|
+
|
53
60
|
def initialize(native_pod_target)
|
54
61
|
@native_pod_target = native_pod_target
|
55
62
|
@name = native_pod_target.name
|
@@ -235,10 +242,11 @@ module KZ
|
|
235
242
|
end
|
236
243
|
|
237
244
|
# 获取target对应的配置根目录,部分文件需要依赖版本进行存储
|
238
|
-
def pod_config_cache_path(concat_version, vendored_framework = false)
|
245
|
+
def pod_config_cache_path(concat_version, vendored_framework = false, on_demand_resources = false)
|
239
246
|
kz_target_config_folder = KZ_POD_CONFIG_POD_TARGETS + @name
|
240
247
|
kz_target_config_folder += @version if concat_version
|
241
248
|
kz_target_config_folder += "vendored_framework" if vendored_framework
|
249
|
+
kz_target_config_folder += "on_demand_resources" if on_demand_resources
|
242
250
|
kz_target_config_folder
|
243
251
|
end
|
244
252
|
|
@@ -341,11 +349,77 @@ module KZ
|
|
341
349
|
@native_pod_target.configuration_build_dir
|
342
350
|
end
|
343
351
|
|
344
|
-
def
|
345
|
-
@
|
352
|
+
def on_demand_resources_info
|
353
|
+
return {} if @on_demand_resources_config_patterns.nil?
|
354
|
+
|
355
|
+
pod_root = self.native_pod_target.sandbox.pod_dir(self.root_name)
|
356
|
+
path_list = Pod::Sandbox::PathList.new(pod_root)
|
357
|
+
list = path_list.glob(@on_demand_resources_config_patterns)
|
358
|
+
result = list.select {|path| path.extname == ".plist" }
|
359
|
+
|
360
|
+
on_demand_resources_info = {}
|
361
|
+
result.each do |config_plist_path|
|
362
|
+
plist_hash = Xcodeproj::Plist.read_from_path(config_plist_path)
|
363
|
+
initial_plist_hash = plist_hash[Initial_Install_Tags]
|
364
|
+
traversal_resource_for_tag(initial_plist_hash, path_list) do |tag_resources|
|
365
|
+
on_demand_resources_info[Initial_Install_Tags] = tag_resources
|
366
|
+
end
|
367
|
+
|
368
|
+
prefetched_plist_hash = plist_hash[Prefetched_Tag_Order]
|
369
|
+
traversal_resource_for_tag(prefetched_plist_hash, path_list) do |tag_resources|
|
370
|
+
on_demand_resources_info[Prefetched_Tag_Order] = tag_resources
|
371
|
+
end
|
372
|
+
|
373
|
+
download_plist_hash = plist_hash[Download_Only_On_Demand]
|
374
|
+
traversal_resource_for_tag(download_plist_hash, path_list) do |tag_resources|
|
375
|
+
on_demand_resources_info[Download_Only_On_Demand] = tag_resources
|
376
|
+
end
|
377
|
+
end
|
378
|
+
on_demand_resources_info
|
346
379
|
end
|
347
|
-
|
348
|
-
|
380
|
+
|
381
|
+
def traversal_resource_for_tag(plist_hash, path_list)
|
382
|
+
if !plist_hash.nil? && plist_hash.size > 0
|
383
|
+
tag_resources = {}
|
384
|
+
|
385
|
+
plist_hash.each do |tag, resource_paths|
|
386
|
+
valid_paths = []
|
387
|
+
resource_paths.each do |resource_path|
|
388
|
+
valid_path = path_list.relative_path_in_snadbox?(resource_path)
|
389
|
+
unless valid_path.nil?
|
390
|
+
valid_paths.append(valid_path)
|
391
|
+
end
|
392
|
+
end
|
393
|
+
if valid_paths.size > 0
|
394
|
+
tag_resources[tag] = valid_paths
|
395
|
+
end
|
396
|
+
end
|
397
|
+
|
398
|
+
yield(tag_resources)
|
399
|
+
end
|
400
|
+
end
|
401
|
+
|
402
|
+
def all_xcassets_paths
|
403
|
+
@all_xcassets_paths ||= begin
|
404
|
+
all_xcassets_paths = []
|
405
|
+
native_pod_target.file_accessors.each do |file_accessor|
|
406
|
+
file_accessor.resource_bundles.map do |_, paths|
|
407
|
+
paths.each do |path|
|
408
|
+
if path.extname == ".xcassets"
|
409
|
+
all_xcassets_paths << path
|
410
|
+
end
|
411
|
+
end
|
412
|
+
end
|
413
|
+
end
|
414
|
+
all_xcassets_paths
|
415
|
+
end
|
416
|
+
end
|
417
|
+
|
418
|
+
def get_swift_lldb_ast_path
|
419
|
+
if current_should_build? and current_uses_swift?
|
420
|
+
return "$(TARGET_BUILD_DIR)/#{root_name}/#{product_name}/Modules/#{product_basename}.swiftmodule/$(NATIVE_ARCH_ACTUAL)-$(LLVM_TARGET_TRIPLE_VENDOR)-$(SHALLOW_BUNDLE_TRIPLE).swiftmodule"
|
421
|
+
end
|
422
|
+
nil
|
349
423
|
end
|
350
424
|
|
351
425
|
end
|
@@ -31,7 +31,7 @@ module KZ
|
|
31
31
|
|
32
32
|
@all_kz_pod_targets.values.each do |kz_pod_target|
|
33
33
|
next unless kz_pod_target.is_dev_pod
|
34
|
-
next unless @specify_pod_names.count > 0 && @specify_pod_names.include?(kz_pod_target.name)
|
34
|
+
next unless @specify_pod_names.count == 0 || (@specify_pod_names.count > 0 && @specify_pod_names.include?(kz_pod_target.name))
|
35
35
|
|
36
36
|
need_repair_files = []
|
37
37
|
kz_pod_target.native_pod_target.file_accessors.each do |file_accessor|
|
@@ -40,14 +40,20 @@ module Pod
|
|
40
40
|
KZ::KZGlobalHelper.instance.kz_pod_config.merge!(kz_pod_config)
|
41
41
|
end
|
42
42
|
|
43
|
-
def
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
on_demand_resources_bundle_id = configure.delete(:on_demand_resources_bundle_id)
|
48
|
-
if !on_demand_resources_bundle_id.nil? && on_demand_resources_bundle_id.is_a?(String)
|
49
|
-
KZ::KZGlobalHelper.instance.on_demand_resources_bundle_id = on_demand_resources_bundle_id
|
43
|
+
def odr_target(name, options = nil)
|
44
|
+
if options
|
45
|
+
raise Informative, "Unsupported options `#{options}` for " \
|
46
|
+
"target `#{name}`."
|
50
47
|
end
|
48
|
+
KZ::KZGlobalHelper.instance.on_demand_resources_info.enable = true
|
49
|
+
KZ::KZGlobalHelper.instance.on_demand_resources_info.odr_target_name = name
|
50
|
+
|
51
|
+
parent = current_target_definition
|
52
|
+
definition = TargetDefinition.new(name, parent)
|
53
|
+
self.current_target_definition = definition
|
54
|
+
yield if block_given?
|
55
|
+
ensure
|
56
|
+
self.current_target_definition = parent
|
51
57
|
end
|
52
58
|
|
53
59
|
end
|
@@ -70,18 +70,38 @@ module Pod
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
+
alias_method :origin_vendored_libraries, :vendored_libraries
|
74
|
+
def vendored_libraries
|
75
|
+
if self.kz_pod_target and KZ::KZGlobalHelper.instance.arm64_simulator
|
76
|
+
return []
|
77
|
+
else
|
78
|
+
origin_vendored_libraries
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
73
82
|
alias_method :origin_vendored_frameworks, :vendored_frameworks
|
74
83
|
def vendored_frameworks
|
75
84
|
if self.kz_pod_target
|
76
|
-
|
77
|
-
if KZ::KZGlobalHelper.instance.arm64_simulator
|
78
|
-
|
85
|
+
new_frameworks = []
|
86
|
+
if KZ::KZGlobalHelper.instance.arm64_simulator
|
87
|
+
libraries = origin_vendored_libraries
|
88
|
+
if libraries.count > 0
|
89
|
+
new_frameworks.concat(KZ::KZFrameworkManager.handle_origin_library(libraries, self.kz_pod_target))
|
90
|
+
end
|
91
|
+
frameworks = origin_vendored_frameworks
|
92
|
+
if frameworks.count > 0
|
93
|
+
new_frameworks.concat(KZ::KZFrameworkManager.handle_origin_framework(frameworks, self.kz_pod_target))
|
94
|
+
end
|
95
|
+
else
|
96
|
+
new_frameworks.concat(origin_vendored_frameworks)
|
79
97
|
end
|
98
|
+
|
99
|
+
# 是否开启framework模式
|
80
100
|
result = KZ::KZGlobalHelper.instance.pod_config_result_with_target(self.kz_pod_target)
|
81
101
|
if !self.spec.test_specification && result
|
82
|
-
|
102
|
+
new_frameworks.concat(result.get_framework_paths)
|
83
103
|
end
|
84
|
-
|
104
|
+
new_frameworks
|
85
105
|
else
|
86
106
|
origin_vendored_frameworks
|
87
107
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'cocoapods/installer'
|
2
2
|
require 'cocoapods-kz/helpers/kz_global_helper'
|
3
|
-
require 'cocoapods-kz/helpers/
|
3
|
+
require 'cocoapods-kz/helpers/kz_generator_hmap'
|
4
4
|
|
5
5
|
module Pod
|
6
6
|
class Installer
|
@@ -12,10 +12,18 @@ module Pod
|
|
12
12
|
# 因为kz_pod_target提供不少方法,需要判断pod文件情况,所以依赖分析需要挪到download之后
|
13
13
|
if KZ::KZGlobalHelper.instance.generate_kz_pod_targets
|
14
14
|
main_project = aggregate_targets.first.user_project
|
15
|
+
main_project.targets.each do |main_target|
|
16
|
+
if main_target.display_name == KZ::KZGlobalHelper.instance.on_demand_resources_info.odr_target_name
|
17
|
+
bundle_id = main_target.build_configurations.first.kz_simple_attributes_buildSettings_hash["PRODUCT_BUNDLE_IDENTIFIER"]
|
18
|
+
KZ::KZGlobalHelper.instance.on_demand_resources_info.bundle_id = bundle_id unless bundle_id.nil?
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
15
22
|
kz_analyer = KZ::KZAnalyzer.new(pod_targets, self.sandbox.development_pods)
|
16
23
|
kz_analyer.analyer
|
17
24
|
KZ::KZGlobalHelper.instance.kz_analyzer = kz_analyer
|
18
25
|
KZ::KZGlobalHelper.instance.kz_generator = KZ::KZGenerator.new(main_project)
|
26
|
+
KZ::KZGlobalHelper.instance.handle_flexCompiler
|
19
27
|
end
|
20
28
|
end
|
21
29
|
|
@@ -24,7 +32,8 @@ module Pod
|
|
24
32
|
if KZ::KZGlobalHelper.instance.kz_pod_enable
|
25
33
|
# hmap的创建需要在download之后,integrate之前
|
26
34
|
KZ::KZGlobalHelper.instance.kz_generator.create_hamp
|
27
|
-
|
35
|
+
|
36
|
+
if KZ::KZGlobalHelper.instance.on_demand_resources_info.enable
|
28
37
|
KZ::KZGlobalHelper.instance.kz_generator.create_on_demand_resources
|
29
38
|
end
|
30
39
|
end
|
@@ -42,26 +42,6 @@ module Pod
|
|
42
42
|
|
43
43
|
target_installation_result
|
44
44
|
end
|
45
|
-
|
46
|
-
alias_method :origin_filter_resource_file_references, :filter_resource_file_references
|
47
|
-
def filter_resource_file_references(resource_file_references)
|
48
|
-
kz_pod_target = self.target.weakRef_kz_pod_target
|
49
|
-
if kz_pod_target
|
50
|
-
new_resource_file_references = []
|
51
|
-
odr_resources = kz_pod_target.get_on_demand_resources
|
52
|
-
resource_file_references.each do |path|
|
53
|
-
new_resource_file_references.push(path) unless odr_resources.include?(path)
|
54
|
-
end
|
55
|
-
origin_filter_resource_file_references(new_resource_file_references) do |compile_phase_refs, resources_phase_refs|
|
56
|
-
yield compile_phase_refs, resources_phase_refs
|
57
|
-
end
|
58
|
-
else
|
59
|
-
origin_filter_resource_file_references(resource_file_references) do |compile_phase_refs, resources_phase_refs|
|
60
|
-
yield compile_phase_refs, resources_phase_refs
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
45
|
end
|
66
46
|
end
|
67
47
|
end
|
@@ -27,5 +27,11 @@ module Pod
|
|
27
27
|
{}
|
28
28
|
end
|
29
29
|
end
|
30
|
+
|
31
|
+
def on_demand_resources_config_plists=(paths)
|
32
|
+
if KZ::KZGlobalHelper.instance.on_demand_resources_info.enable
|
33
|
+
KZ::KZGlobalHelper.instance.on_demand_resources_info.config_plist_path_patterns[self.name] = Array(paths)
|
34
|
+
end
|
35
|
+
end
|
30
36
|
end
|
31
37
|
end
|
@@ -21,6 +21,9 @@ module Pod
|
|
21
21
|
kz_clean_xcconfig(xcconfig)
|
22
22
|
main_hamp_search_path = '"' + KZ::KZ_POD_CONFIG_ROOT_STR + "/#{self.target.user_project.root_object.display_name}.hmap" + '"'
|
23
23
|
pod_targets = self.target.pod_targets_for_build_configuration(generator.configuration_name)
|
24
|
+
|
25
|
+
swift_lldb_ast_paths = []
|
26
|
+
on_demand_resources_config_paths = []
|
24
27
|
pod_targets.each do |native_pod_target|
|
25
28
|
kz_pod_target = native_pod_target.weakRef_kz_pod_target
|
26
29
|
if kz_pod_target
|
@@ -33,15 +36,37 @@ module Pod
|
|
33
36
|
if kz_pod_target.force_load
|
34
37
|
kz_add_force_load_tag(xcconfig, kz_pod_target)
|
35
38
|
end
|
39
|
+
|
40
|
+
# 添加swift ast path
|
41
|
+
ast_path = kz_pod_target.get_swift_lldb_ast_path
|
42
|
+
if !ast_path.nil? and generator.configuration_name == "Debug"
|
43
|
+
swift_lldb_ast_paths << ast_path
|
44
|
+
end
|
45
|
+
|
46
|
+
unless kz_pod_target.on_demand_resources_config_path.nil?
|
47
|
+
on_demand_resources_config_paths << (kz_pod_target.name + ":" + kz_pod_target.on_demand_resources_config_path)
|
48
|
+
end
|
36
49
|
end
|
37
50
|
end
|
51
|
+
|
52
|
+
kz_add_swift_lldb_ast_paths(xcconfig, swift_lldb_ast_paths)
|
38
53
|
xcconfig.attributes['HEADER_SEARCH_PATHS'] = main_hamp_search_path
|
39
54
|
xcconfig.attributes['USE_HEADERMAP'] = 'NO'
|
40
55
|
if KZ::KZGlobalHelper.instance.arm64_simulator
|
41
56
|
xcconfig.attributes.delete("EXCLUDED_ARCHS[sdk=iphonesimulator*]")
|
42
57
|
xcconfig.attributes['VALID_ARCHS'] = 'arm64 arm64_32 x86_64'
|
43
58
|
end
|
44
|
-
|
59
|
+
if KZ::KZGlobalHelper.instance.on_demand_resources_info.odr_target_name == self.target.name.sub('Pods-', '')
|
60
|
+
xcconfig.attributes["ENABLE_ON_DEMAND_RESOURCES"] = "NO"
|
61
|
+
|
62
|
+
on_demadn_resources_paths = ""
|
63
|
+
on_demand_resources_config_paths.each do |path|
|
64
|
+
on_demadn_resources_paths += ((on_demadn_resources_paths.empty? ? '' : ' ') + '"' + path + '"')
|
65
|
+
end
|
66
|
+
xcconfig.attributes["KZ_ON_DEMAND_RESOURCES_PATHS"] = on_demadn_resources_paths unless on_demadn_resources_paths.empty?
|
67
|
+
xcconfig.attributes["KZ_POD_CONFIG_ROOT"] = KZ::KZ_POD_CONFIG_ROOT_STR
|
68
|
+
end
|
69
|
+
|
45
70
|
kz_update_xcconfig_file(xcconfig, path)
|
46
71
|
return
|
47
72
|
end
|
@@ -175,6 +200,16 @@ module Pod
|
|
175
200
|
force_flags.add(KZ.deal_path_for_xcconfig(kz_pod_target.force_load_info, true))
|
176
201
|
end
|
177
202
|
|
203
|
+
def kz_add_swift_lldb_ast_paths(xcconfig, swift_lldb_ast_paths)
|
204
|
+
if swift_lldb_ast_paths.count > 0
|
205
|
+
other_linker_flags = xcconfig.other_linker_flags
|
206
|
+
simple = other_linker_flags[:simple]
|
207
|
+
swift_lldb_ast_paths.each do |swift_lldb_ast_path|
|
208
|
+
simple.add("-Wl,-add_ast_path,#{KZ.deal_path_for_xcconfig(swift_lldb_ast_path, true)}")
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
178
213
|
end
|
179
214
|
end
|
180
215
|
end
|
@@ -7,24 +7,18 @@ module Pod
|
|
7
7
|
alias_method :origin_integrate!, :integrate!
|
8
8
|
def integrate!
|
9
9
|
origin_integrate!
|
10
|
-
|
11
|
-
unless KZ::KZGlobalHelper.instance.on_demand_resources_bundle_id.nil?
|
12
|
-
add_on_demand_resources_script_phase
|
13
|
-
end
|
10
|
+
handle_on_demand_resources_script_phase
|
14
11
|
end
|
15
12
|
|
16
|
-
def
|
13
|
+
def handle_on_demand_resources_script_phase
|
17
14
|
phase_name = "[KZ] On Demand Resources Build"
|
18
15
|
native_targets.each do |native_target|
|
19
|
-
|
20
|
-
|
16
|
+
phase = TargetIntegrator.create_or_update_shell_script_build_phase(native_target, phase_name)
|
17
|
+
if native_target.name == KZ::KZGlobalHelper.instance.on_demand_resources_info.odr_target_name
|
21
18
|
native_target.build_phases.push(phase).uniq! unless native_target.build_phases.include?(phase)
|
22
19
|
phase.shell_script = KZ.deal_path_for_xcconfig(KZ::KZ_ON_DEMAND_RESOURCES_SHELL, true)
|
23
|
-
|
24
|
-
native_target.
|
25
|
-
config.build_settings["ENABLE_ON_DEMAND_RESOURCES"] = "NO"
|
26
|
-
config.build_settings["KZ_POD_CONFIG_ROOT"] = KZ::KZ_POD_CONFIG_ROOT_STR
|
27
|
-
end
|
20
|
+
else
|
21
|
+
native_target.build_phases.delete(phase) if native_target.build_phases.include?(phase)
|
28
22
|
end
|
29
23
|
end
|
30
24
|
end
|
data/lib/cocoapods-kz/native.rb
CHANGED
@@ -14,4 +14,6 @@ if Pod.match_version?('~> 1.11')
|
|
14
14
|
require 'cocoapods-kz/native/pods_project_writer'
|
15
15
|
require 'cocoapods-kz/native/pod_target_integrator'
|
16
16
|
require 'cocoapods-kz/native/target_integrator'
|
17
|
+
require 'cocoapods-kz/native/path_list'
|
18
|
+
require 'cocoapods-kz/native/build_configuration'
|
17
19
|
end
|
Binary file
|