cocoapods-meitu-bin 2.0.0 → 2.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86aab10f2c27b3bfbdf44ed3b6874b7d6be473bb91dcd8a51c0e5906547d48e6
4
- data.tar.gz: a3b0f074a9ee8c24c8043c558314ea3bdfc3b28d1513e87909717547819b8460
3
+ metadata.gz: 44b755bd80acc307a5c25f91cd7d07911fb0f81df3342739a3e099bdbc3eb6e0
4
+ data.tar.gz: fc5c280e229de927df2e429da8494146de709d16429ecc143e05447244ad34a8
5
5
  SHA512:
6
- metadata.gz: '088de3a018fda2b6b9215b61a26e101881fd4ca2a5a1f2ec9c4a9a4773b4ac3d11c4cd880a4ee979fc776a76bb54fcada03ae198b7dc14096903ee8d43a78f1c'
7
- data.tar.gz: 7bf240596cded061b4dc3f86006c4e47f4fa9d5613a37b9d2655943ad8c980930e639159737fcd5f4ec5d7564cb5deecf7918ccfacaaf03257bb8a72a1026763
6
+ metadata.gz: e23a6e77f03c087df977c2d23418e2b5a3da59eca718923dfe9653136dd9ef8252c4596b59ddc1c1c3160b19e810b980f049ffd3303183eb5ce25d61ceea89cf
7
+ data.tar.gz: 20441e3f37762cb9c2039fc1a0bffbbfe1f899d2ec64693570008f4489b27c4f8e17a402dfe7cc01fe3b05a085f51e8aa241219d23ba47772659465b2d32d334
@@ -165,8 +165,15 @@ class PodUpdateConfig
165
165
  @@is_clear = false
166
166
  @@shell_project = false
167
167
  @@external_source_commit = {}
168
+ @@binary_version_pods = []
168
169
 
170
+ def self.set_binary_version_pods(pods)
171
+ @@binary_version_pods = pods
172
+ end
169
173
 
174
+ def self.binary_version_pods
175
+ @@binary_version_pods
176
+ end
170
177
 
171
178
  def self.set_external_source_commit
172
179
  podfile_obj = Pod::Config.instance.podfile
@@ -1,5 +1,5 @@
1
1
  module CBin
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
4
4
 
5
5
  module Pod
@@ -25,11 +25,13 @@ module CBin
25
25
  specs << dependencies_commit_str(pod_name, specifications)
26
26
  end
27
27
  end
28
+ specs << binary_version_pods_str(specifications)
28
29
  specs << minimum_deployment_target_str
29
30
  specs << bundle_identifier_str
30
31
  specs << random_value_str
31
32
  specs << xcode_version
32
33
  specs << (configuration.nil? ? 'Debug' : configuration)
34
+
33
35
  specs_str = specs.join('')
34
36
  if ENV['p_bin_v'] == '1'
35
37
  UI.puts "`#{pod_name}`:#{specs_str}".red
@@ -42,6 +44,85 @@ module CBin
42
44
  "#{original_version}.bin#{specs_str_md5}"
43
45
  end
44
46
 
47
+ # 获取参与二进制版本号生成的组件的tag/commit信息
48
+ def binary_version_pods_str(specifications)
49
+ binary_version_pods = PodUpdateConfig.binary_version_pods
50
+ return '' if binary_version_pods.empty?
51
+
52
+ # 获取所有直接和间接依赖
53
+ all_dependencies = get_all_dependencies(binary_version_pods, specifications)
54
+
55
+ result = []
56
+ all_dependencies.each do |pod_name|
57
+ # 优先使用 external_source_commit
58
+ if PodUpdateConfig.external_source_commit[pod_name]
59
+ result << "#{pod_name}(#{PodUpdateConfig.external_source_commit[pod_name]})"
60
+ next
61
+ end
62
+
63
+ # 如果没有 external_source_commit,则使用版本号
64
+ specifications.each do |spec|
65
+ if spec.root.name == pod_name
66
+ version = spec.root.version.to_s
67
+ # 如果是二进制版本,去掉二进制版本号后缀
68
+ version_arr = version.split('.')
69
+ if version_arr.last.include?('bin')
70
+ version_arr.delete_at(version_arr.size - 1)
71
+ version = version_arr.join('.')
72
+ end
73
+ result << "#{pod_name}(#{version})"
74
+ break
75
+ end
76
+ end
77
+ end
78
+
79
+ if ENV['p_bin_v'] == '1'
80
+ UI.puts "参与二进制版本号生成的组件:#{result.join(',')}".yellow
81
+ end
82
+
83
+ result.join(',')
84
+ end
85
+
86
+ # 递归获取所有依赖(包括直接依赖和间接依赖)
87
+ def get_all_dependencies(pod_names, specifications)
88
+ result = Set.new(pod_names)
89
+ visited = Set.new
90
+
91
+ pod_names.each do |pod_name|
92
+ get_dependencies_recursively(pod_name, specifications, result, visited)
93
+ end
94
+
95
+ # 打印所有PopRock相关的间接依赖
96
+ if ENV['p_bin_d'] == '1'
97
+ poprock_deps = result.select { |name| name.include?('PopRock') }
98
+ if poprock_deps.any?
99
+ UI.puts "\nPopRock相关组件及其依赖:".yellow
100
+ poprock_deps.each do |dep|
101
+ UI.puts "- #{dep}"
102
+ end
103
+ end
104
+ end
105
+
106
+ result.to_a
107
+ end
108
+
109
+ # 递归获取单个组件的所有依赖
110
+ def get_dependencies_recursively(pod_name, specifications, result, visited)
111
+ return if visited.include?(pod_name)
112
+ visited.add(pod_name)
113
+
114
+ specifications.each do |spec|
115
+ if spec.root.name == pod_name
116
+ spec.dependencies.each do |dep|
117
+ next if dep.root_name == pod_name # 跳过自依赖
118
+ result.add(dep.root_name)
119
+ get_dependencies_recursively(dep.root_name, specifications, result, visited)
120
+ end
121
+ break
122
+ end
123
+ end
124
+ end
125
+
45
126
  #最低部署目标,参与二进制版本生成
46
127
  def minimum_deployment_target_str
47
128
  CBin.config.minimum_deployment_target
@@ -1,11 +1,10 @@
1
-
2
-
3
1
  require 'cocoapods'
4
2
  require 'cocoapods-meitu-bin/native/podfile_env'
5
3
 
6
4
  module Pod
7
5
  class Podfile
8
6
  # TREAT_DEVELOPMENTS_AS_NORMAL = 'treat_developments_as_normal'.freeze
7
+ BINARY_VERSION_PODS = 'binary_version_pods'.freeze
9
8
 
10
9
  module DSL
11
10
  def allow_prerelease!
@@ -43,6 +42,13 @@ module Pod
43
42
  def set_configuration_env(env = "dev")
44
43
  set_internal_hash_value(CONFIGURATION_ENV, env)
45
44
  end
45
+
46
+ # 设置参与二进制库版本号生成的组件名称
47
+ def set_binary_version_pods(pods)
48
+ hash_binary_version_pods = get_internal_hash_value(BINARY_VERSION_PODS) || []
49
+ hash_binary_version_pods += Array(pods)
50
+ set_internal_hash_value(BINARY_VERSION_PODS, hash_binary_version_pods)
51
+ end
46
52
  end
47
53
 
48
54
  alias old_plugins plugins
@@ -85,6 +91,11 @@ module Pod
85
91
  get_internal_hash_value(CONFIGURATION, "Debug")
86
92
  end
87
93
 
94
+ # 获取参与二进制库版本号生成的组件名称列表
95
+ def binary_version_pods
96
+ get_internal_hash_value(BINARY_VERSION_PODS, []) + String(ENV[BINARY_VERSION_PODS]).split('|').uniq
97
+ end
98
+
88
99
  private
89
100
 
90
101
  def valid_bin_plugin
@@ -1,5 +1,3 @@
1
-
2
-
3
1
  require 'parallel'
4
2
  require 'cocoapods'
5
3
  require 'cocoapods-meitu-bin/native/podfile'
@@ -146,6 +144,7 @@ module Pod
146
144
 
147
145
  sources_manager = Config.instance.sources_manager
148
146
  use_source_pods = podfile.use_source_pods
147
+ PodUpdateConfig.set_binary_version_pods(podfile.binary_version_pods)
149
148
 
150
149
  # 从BinConfig读取black_list
151
150
  black_list = read_black_list
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-meitu-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-17 00:00:00.000000000 Z
11
+ date: 2025-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel