cocoapods-dongjia 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dca107525ae9be1b7ed4f8bd40b5247cbcc5258035b9a0cc33ad4e4a96def6f3
4
- data.tar.gz: c0d15ab36c6ad63daf5c82cffd1cbd8d41fc30d3a5ba1c1ddab2e3a468d2a36d
3
+ metadata.gz: abe6387bbccd1ac19c893b9c384025c976cf5a8975668725670aac190b750abb
4
+ data.tar.gz: 125582ad4f0aa628467990eb2b43e32007f43043044a4a57a17331a1893bd734
5
5
  SHA512:
6
- metadata.gz: 43b4aa9ab668b94cfca481ab715c5de4f338f4ba22bfdc13c2c0cdbd673ed69aac48668fbe794f56c4a2babed20e527fc5e3c246ec485436b070b3dce02290f2
7
- data.tar.gz: 364c8b20c8dd4c8c1e1255abeaf69049f57c656bb6690cbaea4153278a108d8f84d892505d63c21048cfedac2f55fae29c8fcc775f50c1d32829d67165ea1d55
6
+ metadata.gz: ce36c1a22df3189675dec1775e998fbfdf2a6e413c730db99ea6abfdf90bbf8cb6af04df6d00a90b9b8ce1e7c0c65ee5e4bf1274c2290880b87a03f4b0e44fe6
7
+ data.tar.gz: d9a8b6d5b4496424efb19e4499edacaabf232cdf3069f7ec10cc554de5b2771fe2d63c2596e1e21a5055e3f3197ff3fa7227b9d54b0c31a594e43e852759f93f
@@ -1,11 +1,8 @@
1
1
  require 'cocoapods'
2
2
 
3
3
  module Pod
4
-
5
4
  class Command
6
-
7
5
  class Install < Command
8
-
9
6
  alias_method :run_retryable, :run
10
7
  def run
11
8
  begin
@@ -18,9 +15,6 @@ module Pod
18
15
  end
19
16
  end
20
17
  end
21
-
22
18
  end
23
-
24
19
  end
25
-
26
20
  end
@@ -1,11 +1,8 @@
1
1
  require 'cocoapods'
2
2
 
3
3
  module Pod
4
-
5
4
  class Command
6
-
7
5
  class Open < Command
8
-
9
6
  self.summary = '快速打开项目的 .xcworkspace'
10
7
 
11
8
  self.description = <<-DESC
@@ -24,9 +21,6 @@ module Pod
24
21
  def run
25
22
  `open #{@workspace_path}`
26
23
  end
27
-
28
24
  end
29
-
30
25
  end
31
-
32
26
  end
@@ -178,9 +178,6 @@ module Pod
178
178
  end
179
179
  end
180
180
  end
181
-
182
181
  end
183
-
184
182
  end
185
-
186
183
  end
@@ -1,7 +1,7 @@
1
1
  module CocoapodsDongjia
2
- VERSION = "1.1.6"
2
+ VERSION = "1.1.7"
3
3
  UPDATE_DESC = <<-EOS
4
- - 支持集成二进制版本的 Pod
5
- - 优化 reinstall 命令
4
+ - 修复源码和二进制切换后的集成依赖问题
5
+ - 修复一些导致 crash 的问题
6
6
  EOS
7
7
  end
@@ -1,6 +1,5 @@
1
1
  require 'cocoapods-dongjia/command'
2
2
  require_relative 'dongjia_source'
3
- require_relative 'dongjia_branch_inspector'
4
3
  require_relative 'dongjia_enterprise_inspector'
5
4
  require_relative 'dongjia_pods_iterator'
6
5
  require_relative 'dongjia_router'
@@ -15,9 +14,17 @@ module Dongjia
15
14
 
16
15
  Pod::HooksManager.register('cocoapods-dongjia', :pre_install) do |ctx, params|
17
16
 
18
- Binarization.load_private_config(ctx)
19
-
20
- Binarization.remove_dirty_pod_projects()
17
+ private_config_path = ctx.podfile.defined_in_file.dirname.join("PrivateConfig.yml")
18
+ if private_config_path.exist?
19
+ private_config = YAML.load(File.read(private_config_path))
20
+ if private_config.is_a?(Hash)
21
+ binary = private_config["binary"]
22
+ if binary.is_a?(Hash)
23
+ Binarization.load_private_config(ctx, binary)
24
+ Binarization.remove_dirty_pod_projects()
25
+ end
26
+ end
27
+ end
21
28
 
22
29
  podfile = ctx.podfile
23
30
 
@@ -14,16 +14,16 @@ module Dongjia
14
14
  @@ctx = nil
15
15
  @@pod_cfg = {}
16
16
  @@enabled = false
17
- @@target_name = ""
18
17
  @@submodules = {}
19
18
  @@server_host = ""
20
19
 
21
- # 配置文件 PrivateConfig.yml 是否存在,如果不存在,不做任何额外处理
22
- @@config_file_exist = false
20
+ @@target_name = "dongjia" # 项目的 target
21
+ @@pods_proj = nil # Pods.xcodeproj
22
+ @@pods_target = nil # Pods.xcodeproj 中的 target 对象
23
23
 
24
24
  class << self
25
25
  # 加载配置
26
- def load_private_config(ctx)
26
+ def load_private_config(ctx, binary)
27
27
  @@ctx = ctx
28
28
 
29
29
  submodule_info = load_submodules_info
@@ -34,107 +34,81 @@ module Dongjia
34
34
  ]
35
35
  }
36
36
 
37
- path = ctx.podfile.defined_in_file.dirname.join("PrivateConfig.yml")
38
- if path.exist?
39
- config = YAML.load(File.read(path))
40
- @@config_file_exist = true
41
- if config
42
- binary = config["binary"]
43
- if binary
44
- @@enabled ||= binary["enabled"]
45
- @@server_host = binary["server_host"]
46
- @@target_name = binary["target_name"].strip
47
- ignores = binary["ignores"] || []
48
-
49
- begin
50
- @@submodules = query_components_existing(submodule_info).to_h { |s|
51
- [
52
- s["name"],
53
- { sha: s["sha"], binary: s["binary"], }
54
- ]
55
- }.each { |k, v|
56
- ignored = ignores.include?(k)
57
- v[:binary] &&= !ignored && @@enabled
58
- v[:ignored] = ignored
59
- }
60
- rescue => e
61
- puts "Error: #{e}"
62
- end
63
- end
64
- end
37
+ @@enabled ||= binary["enabled"]
38
+ @@server_host = binary["server_host"]
39
+ @@target_name = (binary["target_name"] || "").strip
40
+ ignores = binary["ignores"] || []
41
+
42
+ if @@enabled
43
+ @@submodules = query_components_existing(submodule_info).to_h { |s|
44
+ [
45
+ s["name"],
46
+ { sha: s["sha"], binary: s["binary"], }
47
+ ]
48
+ }.each { |k, v|
49
+ ignored = ignores.include?(k)
50
+ v[:binary] &&= !ignored && @@enabled
51
+ v[:ignored] = ignored
52
+ }
65
53
  end
54
+ rescue => e
55
+ puts "Binarization error: #{e}"
66
56
  end
67
57
 
68
58
  # 移除脏工程
69
59
  def remove_dirty_pod_projects
70
- @@submodules
71
- .filter { |k,v| !v[:binary] }
72
- .map { |k,v| k }
73
- .each { |name|
74
- path = "./Pods/#{name}.xcodeproj"
75
- next unless File.exist?(path)
60
+ if @@enabled
61
+ @@submodules
62
+ .filter { |k,v| !v[:binary] }
63
+ .map { |k,v| k }
64
+ .each { |name|
65
+ path = File.join(@@ctx.sandbox_root, "#{name}.xcodeproj")
66
+ next unless File.exist?(path)
67
+ proj = Xcodeproj::Project.open(path)
68
+ if proj.targets.map(&:name).include?("#{name}-Binary")
69
+ FileUtils.rm_rf(path)
70
+ end
71
+ }
72
+ else
73
+ # 不启用,清除所有包含 -Binary 的工程
74
+ removing_paths = []
75
+ Dir.foreach(@@ctx.sandbox_root) { |filename|
76
+ next if File.extname(filename) != '.xcodeproj'
77
+ pod_name = filename.delete_suffix('.xcodeproj')
78
+ next if pod_name == "Pods"
79
+ process_pod_xcconfig(pod_name)
80
+ path = File.join(@@ctx.sandbox_root, filename)
76
81
  proj = Xcodeproj::Project.open(path)
77
- if proj.targets.map(&:name).include?("#{name}-Binary")
78
- FileUtils.rm_rf(path)
79
- end
80
- }
81
- end
82
-
83
- # 加载子模块信息
84
- def load_submodules_info
85
- # 获取子模块的哈希值
86
- def git_sha_value(component_name)
87
- git_dir = ".git/modules/componentsOnRemote/#{component_name}"
88
- git_sha = File.read(File.join(git_dir, "HEAD")).strip
89
- if git_sha.start_with?("ref: ")
90
- head_file = git_sha[5, git_sha.length]
91
- git_sha = File.read(File.join(git_dir, head_file)).strip
92
- end
93
- git_sha
94
- end
95
-
96
- Dir.foreach("./componentsOnRemote").to_a
97
- .delete_if { |x| x.start_with?('.') }
98
- .map { |comp|
99
- {
100
- name: comp,
101
- sha: git_sha_value(comp),
102
- binary: false,
82
+ included_binary_target = proj.targets.map(&:name).any? { |target_name|
83
+ target_name.end_with?("-Binary")
103
84
  }
85
+ removing_paths << path if included_binary_target
104
86
  }
87
+ removing_paths.each { |path| FileUtils.rm_rf(path) }
88
+ end
105
89
  end
106
90
 
107
91
  # 开始处理二进制
108
92
  def process(installer)
109
- return unless @@config_file_exist
110
93
  return if @@ctx == nil || @@ctx.sandbox_root == nil
111
94
 
112
- installer.analysis_result.podfile_dependency_cache.podfile_dependencies.each { |dep|
113
- name = dep.name.split('/').first
114
- next if @@pod_cfg.include?(name)
115
- @@pod_cfg[name] = @@submodules[name] || {
116
- binary: false
117
- }
118
- }
119
-
120
- pods_proj = Xcodeproj::Project.open(File.join(@@ctx.sandbox_root, "Pods.xcodeproj"))
121
- if @@target_name && !@@target_name.empty?
122
- pods_target = pods_proj.targets.find { |t| t.name == "Pods-#{@@target_name}" }
123
- else
124
- pods_target = pods_proj.targets.first
95
+ path = File.join(@@ctx.sandbox_root, "Pods.xcodeproj")
96
+ @@pods_proj = Xcodeproj::Project.open(path) if File.exist?(path)
97
+ @@pods_target = (@@target_name.empty?) ? @@pods_proj.targets.first : @@pods_proj.target_by_name("Pods-#{@@target_name}")
98
+ if @@pods_target.nil?
99
+ Pod::UI.warn("[Binarization] 未完成二进制转换,target_name 配置错误")
100
+ return
125
101
  end
126
102
 
103
+ setup_pod_cfg(installer)
104
+
127
105
  download_frameworks
128
106
 
129
- each_pod_proj do |name|
130
- proj = Xcodeproj::Project.open(File.join(@@ctx.sandbox_root, "#{name}.xcodeproj"))
131
- cfg = @@pod_cfg[name]
132
- cfg[:project] = proj
133
-
134
- cfg[:save] = process_target_and_dependencies(proj, name, pods_target, cfg)
107
+ each_pod_proj do |name, cfg|
108
+ process_pods_project_dependencies(name)
135
109
 
136
110
  # 处理 Binary Group
137
- process_binary_group(proj, name)
111
+ process_binary_group(name)
138
112
 
139
113
  # 处理 XXX-xcframeworks.sh 脚本
140
114
  process_xcframeworks_shell(name)
@@ -143,38 +117,68 @@ module Dongjia
143
117
  end
144
118
 
145
119
  # 更新依赖关系
146
- each_pod_proj do |name|
147
- cfg = @@pod_cfg[name]
148
- proj = cfg[:project]
120
+ each_pod_proj do |name, cfg|
149
121
  target = cfg[:target]
150
122
  next if target.nil?
151
123
  delete_list = []
124
+ add_list = []
152
125
  target.dependencies.each { |dep|
153
- dep_cfg = @@pod_cfg[dep.name]
126
+ dep_pod_name = real_name(dep.name)
127
+ dep_cfg = @@pod_cfg[dep_pod_name]
154
128
  next if dep_cfg.nil?
155
- if dep_cfg[:binary]
156
- target.add_dependency(dep_cfg[:target])
129
+ if dep_cfg[:target].name != dep.name
130
+ add_list << dep_cfg[:target]
157
131
  delete_list << dep
158
132
  end
159
133
  }
160
134
  target.dependencies.delete_if { |dep| delete_list.include?(dep) }
161
- cfg[:save] ||= !delete_list.empty?
135
+ add_list.each { |t| target.add_dependency(t) }
136
+ cfg[:save] ||= !delete_list.empty? || !add_list.empty?
162
137
  end
163
138
 
164
139
  # 保存
165
- should_save = false
166
- each_pod_proj do |name|
167
- cfg = @@pod_cfg[name]
168
- cfg[:project].save if cfg[:save]
169
- should_save ||= cfg[:save]
170
- end
171
- pods_proj.save if should_save
140
+ save_projects
172
141
 
173
142
  process_aggregate_target_xcconfig(installer.aggregate_targets.first.name)
174
143
  end
175
144
 
176
145
  private
177
146
 
147
+ # 加载配置
148
+ def setup_pod_cfg(installer)
149
+ installer.analysis_result.podfile_dependency_cache.podfile_dependencies.each { |dep|
150
+ name = dep.name.split('/').first
151
+ cfg = @@submodules[name] || {}
152
+ cfg[:binary] = false unless cfg[:binary]
153
+ cfg[:save] = false unless cfg[:save]
154
+ cfg[:project] = Xcodeproj::Project.open(File.join(@@ctx.sandbox_root, "#{name}.xcodeproj"))
155
+ @@pod_cfg[name] = cfg
156
+ }
157
+ end
158
+
159
+ # 获取实际的 pod 名,如果有 -Binary 后缀,则去除后缀
160
+ def real_name(name)
161
+ name = name.delete_suffix("-Binary") if name.end_with?("-Binary")
162
+ return name
163
+ end
164
+
165
+ def save_projects
166
+ if Pod::Config.instance.verbose == true
167
+ pods_should_save = @@pod_cfg.filter { |k, v| v[:save] }.keys
168
+ Pod::UI.notice "Saving Pods project" unless pods_should_save.empty?
169
+ pods_should_save.each { |name|
170
+ puts " #{name}"
171
+ }
172
+ end
173
+
174
+ should_save = false
175
+ each_pod_proj do |name, cfg|
176
+ cfg[:project].save if cfg[:save]
177
+ should_save ||= cfg[:save]
178
+ end
179
+ @@pods_proj.save if !@@pods_proj.nil? && should_save
180
+ end
181
+
178
182
  # 遍历 Pods 目录下的 xcodeproj
179
183
  def each_pod_proj
180
184
  Dir.foreach(@@ctx.sandbox_root) do |filename|
@@ -184,13 +188,15 @@ module Dongjia
184
188
  next if name == 'Pods'
185
189
 
186
190
  cfg = @@pod_cfg[name]
191
+ next if cfg.nil?
187
192
 
188
- yield(name) if block_given?
193
+ yield(name, cfg) if block_given?
189
194
  end
190
195
  end
191
196
 
192
197
  # 向服务器查询哪些 Pod 需要打包
193
198
  def query_components_existing(components)
199
+ return components unless @@enabled
194
200
  result = components
195
201
  begin
196
202
  uri = URI.parse(URI::join(@@server_host, 'api/binary/checkup').to_s)
@@ -204,49 +210,94 @@ module Dongjia
204
210
  end
205
211
  result = JSON.parse(resp.body).dig('res', 'components')
206
212
  rescue => e
207
- puts "Error: #{e}"
213
+ puts "Binarization error: #{e}"
208
214
  end
209
215
  return result
210
216
  end
211
217
 
212
- def process_target_and_dependencies(proj, name, pods_target, cfg)
218
+ # 加载子模块信息
219
+ def load_submodules_info
220
+ return [] unless File.exist?("./componentsOnRemote")
221
+
222
+ # 获取子模块的哈希值
223
+ def git_sha_value(component_name)
224
+ git_dir = ".git/modules/componentsOnRemote/#{component_name}"
225
+ git_sha = File.read(File.join(git_dir, "HEAD")).strip
226
+ if git_sha.start_with?("ref: ")
227
+ head_file = git_sha[5, git_sha.length]
228
+ head_path = File.join(git_dir, head_file)
229
+ if File.exist?(head_path)
230
+ git_sha = File.read(head_path).strip
231
+ else
232
+ git_sha = nil
233
+ end
234
+ end
235
+ git_sha
236
+ end
237
+
238
+ Dir.foreach("./componentsOnRemote").to_a
239
+ .delete_if { |x| x.start_with?('.') }
240
+ .delete_if { |x|
241
+ # 如果子模块初始化错误,会导致目录下没有内容,需要排除掉
242
+ Dir.foreach("./componentsOnRemote/#{x}").to_a.all? { |f| f.start_with?(".") }
243
+ }
244
+ .map { |comp|
245
+ {
246
+ name: comp,
247
+ sha: git_sha_value(comp),
248
+ binary: false,
249
+ }
250
+ }
251
+ end
252
+
253
+ # 处理 Pods.xcodeproj 的依赖
254
+ def process_pods_project_dependencies(name)
255
+ cfg = @@pod_cfg[name]
256
+ proj = cfg[:project]
213
257
  changed = false
214
- source_target = proj.target_by_name(name)
215
- binary_target = proj.target_by_name("#{name}-Binary")
258
+
259
+ latest_target = nil
260
+ removing_target_name = nil
216
261
 
217
262
  if cfg[:binary] == true
218
- # 使用 Binary 版本的 target
263
+ # 使用 Binary 版本的 target,如果不存在则创建一个
264
+ binary_target = proj.target_by_name("#{name}-Binary")
219
265
  if binary_target == nil
220
266
  binary_target = add_binary_target(proj, name)
221
267
  changed = true
222
268
  end
223
269
 
224
- @@pod_cfg[name][:target] = binary_target
225
-
226
- # 移除源码版本的 target
227
- if source_target
228
- replace_target_dependency(pods_target, source_target, binary_target)
229
- proj.targets.delete_if { |t| t == source_target }
230
- changed = true
231
- end
270
+ latest_target = binary_target
271
+ removing_target_name = name
232
272
  else
233
- @@pod_cfg[name][:target] = source_target
234
273
  # 使用源码版本的 target
274
+ source_target = proj.target_by_name(name)
235
275
  source_target.build_configurations.each { |cfg|
236
276
  if cfg.build_settings["BUILD_LIBRARY_FOR_DISTRIBUTION"] != "YES"
237
277
  cfg.build_settings["BUILD_LIBRARY_FOR_DISTRIBUTION"] = "YES"
238
278
  changed = true
239
279
  end
240
280
  }
281
+
282
+ latest_target = source_target
283
+ removing_target_name = "#{name}-Binary"
241
284
  end
242
- changed
285
+
286
+ cfg[:target] = latest_target
287
+
288
+ # 更新依赖
289
+ changed = update_pods_target_dependency(removing_target_name, latest_target) || changed
290
+ changed = proj.targets.map(&:name).include?(removing_target_name) || changed
291
+ proj.targets.delete_if { |t| t.name == removing_target_name }
292
+
293
+ cfg[:save] = changed
243
294
  end
244
295
 
245
- # 处理对应 pod 的 xcconfig
296
+ # 处理组件 pod 的 xcconfig
246
297
  def process_pod_xcconfig(name)
247
298
  # 根据 pod 是源码还是二进制包,切换路径为 PODS_CONFIGURATION_BUILD_DIR 或 PODS_XCFRAMEWORKS_BUILD_DIR
248
299
  ["debug", "release"].each { |cfg_name|
249
- cfg_path = Pathname("./Pods/Target Support Files/#{name}/#{name}.#{cfg_name}.xcconfig")
300
+ cfg_path = Pathname(File.join(@@ctx.sandbox_root, "Target Support Files", name, "#{name}.#{cfg_name}.xcconfig"))
250
301
  next if not File.exist?(cfg_path)
251
302
  cfg = Xcodeproj::Config.new(cfg_path)
252
303
  fsp_str = cfg.attributes["FRAMEWORK_SEARCH_PATHS"] || "$(inherited)"
@@ -283,7 +334,7 @@ module Dongjia
283
334
  # 处理 Pods/Target Support Files/Pods-项目名/Pods-项目名.debug(release).xcconfig
284
335
  # 所有被二进制化的 pod,增加 "${PODS_XCFRAMEWORKS_BUILD_DIR}/#{pod_name}"
285
336
  ["debug", "release"].each { |cfg_name|
286
- cfg_path = Pathname("./Pods/Target Support Files/#{aggregate_target_name}/#{aggregate_target_name}.#{cfg_name}.xcconfig")
337
+ cfg_path = Pathname(File.join(@@ctx.sandbox_root, "Target Support Files", aggregate_target_name, "#{aggregate_target_name}.#{cfg_name}.xcconfig"))
287
338
  next if not File.exist?(cfg_path)
288
339
  cfg = Xcodeproj::Config.new(cfg_path)
289
340
  fsp = cfg.attributes["FRAMEWORK_SEARCH_PATHS"].split(" ") || ["$(inherited)"]
@@ -316,20 +367,33 @@ module Dongjia
316
367
 
317
368
  # 添加依赖
318
369
  bin_target.dependencies.replace(source_target.dependencies)
370
+
319
371
  return bin_target
320
372
  end
321
373
 
322
- def replace_target_dependency(target, from_dep_target, to_dep_target)
323
- dep_names = target.dependencies.map(&:name)
324
- index = dep_names.index(from_dep_target.name)
325
- return false if !index
326
- target.dependencies.delete_at(index)
327
- target.add_dependency(to_dep_target)
328
- return true
374
+ # 更新 Pods.xcodeproj 中 target 的依赖关系
375
+ def update_pods_target_dependency(removing_target_name, new_target)
376
+ dep_names = @@pods_target.dependencies.map(&:name)
377
+ changed = false
378
+
379
+ index = dep_names.index(removing_target_name)
380
+ if index
381
+ @@pods_target.dependencies.delete_at(index)
382
+ changed = true
383
+ end
384
+
385
+ index = dep_names.index(new_target.name)
386
+ unless index
387
+ @@pods_target.add_dependency(new_target)
388
+ changed = true
389
+ end
390
+
391
+ return changed
329
392
  end
330
393
 
331
394
  # 下载 framework 到 Pods/_Frameworks 目录下
332
395
  def download_frameworks
396
+ return unless @@enabled
333
397
  framework_root = File.join(@@ctx.sandbox_root, "_Frameworks")
334
398
  cache_root = File.join(framework_root, "Caches")
335
399
  FileUtils.mkdir_p(cache_root) unless File.exist?(cache_root)
@@ -359,8 +423,9 @@ module Dongjia
359
423
  }
360
424
  end
361
425
 
362
- def process_binary_group(proj, name)
426
+ def process_binary_group(name)
363
427
  cfg = @@pod_cfg[name]
428
+ proj = cfg[:project]
364
429
  binary_group = proj.groups.find { |g| g.name == "Binary" }
365
430
  if cfg[:binary] == true
366
431
  if binary_group == nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-dongjia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiangzhuoyi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-29 00:00:00.000000000 Z
11
+ date: 2021-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -112,7 +112,6 @@ files:
112
112
  - lib/cocoapods-dongjia/gem_version.rb
113
113
  - lib/cocoapods_plugin.rb
114
114
  - lib/dongjia_binarization.rb
115
- - lib/dongjia_branch_inspector.rb
116
115
  - lib/dongjia_config.rb
117
116
  - lib/dongjia_enterprise_inspector.rb
118
117
  - lib/dongjia_pods_iterator.rb
@@ -130,8 +129,8 @@ licenses:
130
129
  - MIT
131
130
  metadata:
132
131
  update_desc: |2
133
- - 支持集成二进制版本的 Pod
134
- - 优化 reinstall 命令
132
+ - 修复源码和二进制切换后的集成依赖问题
133
+ - 修复一些导致 crash 的问题
135
134
  post_install_message:
136
135
  rdoc_options: []
137
136
  require_paths:
@@ -1,43 +0,0 @@
1
- require 'cocoapods'
2
-
3
- module Pod
4
-
5
- class Podfile
6
-
7
- gitdir = File.join(Dir.pwd, '.git')
8
- if File.exist?(gitdir)
9
-
10
- # 获取当前分支,仅对 dev 和 master 进行校验
11
- branch = `git symbolic-ref --short -q HEAD`.strip
12
- if branch == 'dev' or branch == 'master'
13
-
14
- # Hook pod 方法
15
- alias_method :pod_alias_by_inspector, :pod
16
-
17
- def pod(name = nil, *requirements, &block)
18
-
19
- if name.start_with?('DJ') && requirements.count > 0
20
- req = requirements.first
21
- if req[:branch] && req[:branch] != 'master'
22
- UI.warn "检测到 #{name} 指向了分支 #{req[:branch]}\n"
23
- exit -1
24
- elsif req[:tag]
25
- UI.warn "检测到 #{name} 指向了标签 #{req[:tag]}\n"
26
- exit -1
27
- elsif req[:commit]
28
- UI.warn "检测到 #{name} 指向了节点 #{req[:commit]}\n"
29
- exit -1
30
- end
31
- end
32
-
33
- pod_alias_by_inspector(name, *requirements, &block)
34
- end
35
-
36
- end
37
-
38
- end
39
-
40
- end
41
-
42
- end
43
-