cocoapods-mtxx-bin 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-mtxx-bin/gem_version.rb +1 -1
- data/lib/cocoapods-mtxx-bin/native/analyzer.rb +26 -6
- data/lib/cocoapods-mtxx-bin/native/installation_options.rb +4 -1
- data/lib/cocoapods-mtxx-bin/native/installer.rb +22 -52
- data/lib/cocoapods-mtxx-bin/native/pod_target_installer.rb +0 -7
- data/lib/cocoapods-mtxx-bin/native/resolver.rb +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c59fa44939d32b5a5422f0646ea4729c41891e6acf7915cae4d944285c4d897
|
4
|
+
data.tar.gz: e76cb2fbf759274440591980a15935bb450992b0ab62b931413fabb937c1876b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9f522fc8a561fe0cd06b287b30c456579fe20eb7ad576a91a1abb5a727a96ad44a994cfcab3330771c15c88eef6a1be554edae02b288f03aeee9136ae711dea
|
7
|
+
data.tar.gz: 15a88b10bb581930ce29bd61a2a49b75fcda4e8f9e6e76eec0a715618e1c53ed461b0dbb92efae72cfd5867801ba87b58a0779ce89ba9e2adb372e38113bc925
|
@@ -1,11 +1,30 @@
|
|
1
1
|
|
2
|
-
|
3
2
|
require 'parallel'
|
4
3
|
require 'cocoapods'
|
5
4
|
|
6
5
|
module Pod
|
7
6
|
class Installer
|
8
7
|
class Analyzer
|
8
|
+
alias old_fetch_external_sources fetch_external_sources
|
9
|
+
def fetch_external_sources(podfile_state)
|
10
|
+
verify_no_pods_with_different_sources!
|
11
|
+
deps = dependencies_to_fetch(podfile_state)
|
12
|
+
pods = pods_to_fetch(podfile_state)
|
13
|
+
return if deps.empty?
|
14
|
+
UI.section 'Fetching external sources' do
|
15
|
+
if installation_options.install_with_multi_threads
|
16
|
+
thread_count = installation_options.multi_threads_count
|
17
|
+
Parallel.each(deps.sort, in_threads: thread_count) do |dependency|
|
18
|
+
fetch_external_source(dependency, !pods.include?(dependency.root_name))
|
19
|
+
end
|
20
|
+
else
|
21
|
+
deps.sort.each do |dependency|
|
22
|
+
fetch_external_source(dependency, !pods.include?(dependency.root_name))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
9
28
|
# > 1.6.0
|
10
29
|
# all_specs[dep.name] 为 nil 会崩溃
|
11
30
|
# 主要原因是 all_specs 分析错误
|
@@ -32,15 +51,16 @@ module Pod
|
|
32
51
|
#
|
33
52
|
alias old_update_repositories update_repositories
|
34
53
|
def update_repositories
|
35
|
-
if installation_options.
|
54
|
+
if installation_options.update_source_with_multi_threads
|
36
55
|
# 并发更新私有源
|
37
56
|
# 这里多线程会导致 pod update 额外输出 --verbose 的内容
|
38
57
|
# 不知道为什么?
|
39
|
-
|
40
|
-
|
41
|
-
|
58
|
+
thread_count = installation_options.multi_threads_count
|
59
|
+
Parallel.each(sources.uniq(&:url), in_threads: thread_count) do |source|
|
60
|
+
if source.updateable?
|
61
|
+
sources_manager.update(source.name, true)
|
42
62
|
else
|
43
|
-
UI.message "Skipping `#{source.name}` update because the repository is not
|
63
|
+
UI.message "Skipping `#{source.name}` update because the repository is not an updateable repository."
|
44
64
|
end
|
45
65
|
end
|
46
66
|
@specs_updated = true
|
@@ -19,7 +19,10 @@ module Pod
|
|
19
19
|
env_option :install_with_multi_threads, false
|
20
20
|
|
21
21
|
# 是否多进程执行 update_repositories
|
22
|
-
env_option :
|
22
|
+
env_option :update_source_with_multi_threads, false
|
23
|
+
|
24
|
+
# 并发执行个数
|
25
|
+
option :multi_threads_count, 4
|
23
26
|
end
|
24
27
|
end
|
25
28
|
end
|
@@ -16,70 +16,32 @@ module Pod
|
|
16
16
|
alias old_install_pod_sources install_pod_sources
|
17
17
|
def install_pod_sources
|
18
18
|
if installation_options.install_with_multi_threads
|
19
|
-
|
20
|
-
install_pod_sources_for_version_in_1_4_0
|
21
|
-
elsif Pod.match_version?('~> 1.5')
|
22
|
-
install_pod_sources_for_version_above_1_5_0
|
23
|
-
else
|
24
|
-
old_install_pod_sources
|
25
|
-
end
|
19
|
+
install_pod_sources_with_multiple_threads
|
26
20
|
else
|
27
21
|
old_install_pod_sources
|
28
22
|
end
|
29
23
|
end
|
30
24
|
|
31
|
-
#
|
32
|
-
def
|
33
|
-
@installed_specs = []
|
34
|
-
pods_to_install = sandbox_state.added | sandbox_state.changed
|
35
|
-
title_options = { verbose_prefix: '-> '.green }
|
36
|
-
Parallel.each(root_specs.sort_by(&:name), in_threads: 4) do |spec|
|
37
|
-
if pods_to_install.include?(spec.name)
|
38
|
-
if sandbox_state.changed.include?(spec.name) && sandbox.manifest
|
39
|
-
previous = sandbox.manifest.version(spec.name)
|
40
|
-
title = "Installing #{spec.name} #{spec.version} (was #{previous})"
|
41
|
-
else
|
42
|
-
title = "Installing #{spec}"
|
43
|
-
end
|
44
|
-
UI.titled_section(title.green, title_options) do
|
45
|
-
install_source_of_pod(spec.name)
|
46
|
-
end
|
47
|
-
else
|
48
|
-
UI.titled_section("Using #{spec}", title_options) do
|
49
|
-
create_pod_installer(spec.name)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
def install_pod_sources_for_version_above_1_5_0
|
25
|
+
# 多线程下载
|
26
|
+
def install_pod_sources_with_multiple_threads
|
56
27
|
@installed_specs = []
|
57
28
|
pods_to_install = sandbox_state.added | sandbox_state.changed
|
58
|
-
title_options = { verbose_prefix
|
59
|
-
|
60
|
-
|
61
|
-
Parallel.each(root_specs.sort_by(&:name), in_threads: 4) do |spec|
|
29
|
+
title_options = { :verbose_prefix => '-> '.green }
|
30
|
+
thread_count = installation_options.multi_threads_count
|
31
|
+
Parallel.each(root_specs.sort_by(&:name), in_threads: thread_count) do |spec|
|
62
32
|
if pods_to_install.include?(spec.name)
|
63
33
|
if sandbox_state.changed.include?(spec.name) && sandbox.manifest
|
64
34
|
current_version = spec.version
|
65
35
|
previous_version = sandbox.manifest.version(spec.name)
|
66
36
|
has_changed_version = current_version != previous_version
|
67
|
-
current_repo = analysis_result.specs_by_source.detect
|
68
|
-
|
69
|
-
end
|
70
|
-
current_repo &&= current_repo.url || current_repo.name
|
37
|
+
current_repo = analysis_result.specs_by_source.detect { |key, values| break key if values.map(&:name).include?(spec.name) }
|
38
|
+
current_repo &&= (Pod::TrunkSource::TRUNK_REPO_NAME if current_repo.name == Pod::TrunkSource::TRUNK_REPO_NAME) || current_repo.url || current_repo.name
|
71
39
|
previous_spec_repo = sandbox.manifest.spec_repo(spec.name)
|
72
|
-
has_changed_repo = !previous_spec_repo.nil? && current_repo && (
|
40
|
+
has_changed_repo = !previous_spec_repo.nil? && current_repo && !current_repo.casecmp(previous_spec_repo).zero?
|
73
41
|
title = "Installing #{spec.name} #{spec.version}"
|
74
|
-
if has_changed_version && has_changed_repo
|
75
|
-
|
76
|
-
|
77
|
-
if has_changed_version && !has_changed_repo
|
78
|
-
title += " (was #{previous_version})"
|
79
|
-
end
|
80
|
-
if !has_changed_version && has_changed_repo
|
81
|
-
title += " (source changed to `#{current_repo}` from `#{previous_spec_repo}`)"
|
82
|
-
end
|
42
|
+
title << " (was #{previous_version} and source changed to `#{current_repo}` from `#{previous_spec_repo}`)" if has_changed_version && has_changed_repo
|
43
|
+
title << " (was #{previous_version})" if has_changed_version && !has_changed_repo
|
44
|
+
title << " (source changed to `#{current_repo}` from `#{previous_spec_repo}`)" if !has_changed_version && has_changed_repo
|
83
45
|
else
|
84
46
|
title = "Installing #{spec}"
|
85
47
|
end
|
@@ -87,7 +49,7 @@ module Pod
|
|
87
49
|
install_source_of_pod(spec.name)
|
88
50
|
end
|
89
51
|
else
|
90
|
-
UI.
|
52
|
+
UI.section("Using #{spec}", title_options[:verbose_prefix]) do
|
91
53
|
create_pod_installer(spec.name)
|
92
54
|
end
|
93
55
|
end
|
@@ -128,7 +90,15 @@ module Pod
|
|
128
90
|
# old_ensure_matching_version 会移除不是同一个 CocoaPods 版本的组件缓存
|
129
91
|
alias old_ensure_matching_version ensure_matching_version
|
130
92
|
def ensure_matching_version
|
131
|
-
@@lock.synchronize
|
93
|
+
@@lock.synchronize do
|
94
|
+
version_file = root + 'VERSION'
|
95
|
+
# version = version_file.read.strip if version_file.file?
|
96
|
+
|
97
|
+
# root.rmtree if version != Pod::VERSION && root.exist?
|
98
|
+
root.mkpath
|
99
|
+
|
100
|
+
version_file.open('w') { |f| f << Pod::VERSION }
|
101
|
+
end
|
132
102
|
end
|
133
103
|
end
|
134
104
|
end
|
@@ -22,10 +22,7 @@ module Pod
|
|
22
22
|
alias old_add_swift_library_compatibility_header_phase add_swift_library_compatibility_header_phase
|
23
23
|
|
24
24
|
def add_swift_library_compatibility_header_phase(native_target)
|
25
|
-
UI.puts "====== swift add_swift_library_compatibility_header_phase ======".yellow
|
26
25
|
if $ARGV[1] == "auto"
|
27
|
-
UI.puts "====== auto swift add_swift_library_compatibility_header_phase ======".yellow
|
28
|
-
|
29
26
|
if custom_module_map
|
30
27
|
raise Informative, 'Using Swift static libraries with custom module maps is currently not supported. ' \
|
31
28
|
"Please build `#{target.label}` as a framework or remove the custom module map."
|
@@ -80,13 +77,9 @@ module Pod
|
|
80
77
|
${BUILT_PRODUCTS_DIR}/Swift\ Compatibility\ Header/${PRODUCT_MODULE_NAME}-Swift.h
|
81
78
|
)
|
82
79
|
else
|
83
|
-
UI.puts "====== null swift add_swift_library_compatibility_header_phase ======".yellow
|
84
80
|
old_add_swift_library_compatibility_header_phase(native_target)
|
85
81
|
end
|
86
|
-
|
87
82
|
end
|
88
|
-
|
89
|
-
#-----------------------------------------------------------------------#
|
90
83
|
end
|
91
84
|
end
|
92
85
|
end
|
@@ -189,8 +189,8 @@ module Pod
|
|
189
189
|
|
190
190
|
raise Informative, "#{rspec.root.name}(#{spec_version})的podspec未找到,请执行 pod repo update 或添加相应的source源" unless source
|
191
191
|
|
192
|
-
UI.message "------------------- 分界线 -----------------------"
|
193
|
-
UI.message "- 开始处理 #{rspec.spec.name}(#{spec_version}) 组件(#{use_binary ? '二进制' : '源码'})."
|
192
|
+
# UI.message "------------------- 分界线 -----------------------"
|
193
|
+
# UI.message "- 开始处理 #{rspec.spec.name}(#{spec_version}) 组件(#{use_binary ? '二进制' : '源码'})."
|
194
194
|
|
195
195
|
begin
|
196
196
|
# 从新 source 中获取 spec,在bin archive中会异常,因为找不到
|
@@ -219,11 +219,11 @@ module Pod
|
|
219
219
|
else
|
220
220
|
ResolverSpecification.new(specification, used_by_only, source)
|
221
221
|
end
|
222
|
-
UI.message "组装新的 rspec ,替换原 rspec #{rspec.root.name} (#{spec_version}) specification = #{specification} #{rspec} "
|
222
|
+
# UI.message "组装新的 rspec ,替换原 rspec #{rspec.root.name} (#{spec_version}) specification = #{specification} #{rspec} "
|
223
223
|
rescue Pod::StandardError => e
|
224
224
|
# 没有从新的 source 找到对应版本组件,直接返回原 rspec
|
225
225
|
missing_binary_specs << rspec.spec if use_binary
|
226
|
-
UI.message "【#{rspec.spec.name} | #{rspec.spec.version}】组件无对应源码版本 , 将采用二进制版本依赖.".red unless use_binary
|
226
|
+
# UI.message "【#{rspec.spec.name} | #{rspec.spec.version}】组件无对应源码版本 , 将采用二进制版本依赖.".red unless use_binary
|
227
227
|
rspec
|
228
228
|
end
|
229
229
|
rspec
|
@@ -232,7 +232,7 @@ module Pod
|
|
232
232
|
|
233
233
|
if missing_binary_specs.any?
|
234
234
|
missing_binary_specs.uniq.each do |spec|
|
235
|
-
UI.message "【#{spec.name} | #{spec.version}】组件无对应二进制版本 , 将采用源码依赖." unless spec.root.source[:type] == 'zip'
|
235
|
+
# UI.message "【#{spec.name} | #{spec.version}】组件无对应二进制版本 , 将采用源码依赖." unless spec.root.source[:type] == 'zip'
|
236
236
|
end
|
237
237
|
# 下面的代码为了实现 auto 命令的 --all-make
|
238
238
|
Pod::Command::Bin::Archive.missing_binary_specs(missing_binary_specs)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-mtxx-bin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|