podfileDep 2.7.7 → 3.0.0
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/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/cocoapods_plugin.rb +15 -10
- data/lib/{podfileDep → core_blur}/check/import.rb +1 -20
- data/lib/{podfileDep → core_blur}/check/item.rb +1 -64
- data/lib/{podfileDep → core_blur}/check/podspec.rb +1 -54
- data/lib/{podfileDep → core_blur}/check/project.rb +1 -73
- data/lib/{podfileDep → core_blur}/check/util.rb +1 -13
- data/lib/{podfileDep → core_blur}/check/xcodeproj.rb +1 -28
- data/lib/{podfileDep → core_blur}/command/all.rb +1 -8
- data/lib/{podfileDep → core_blur}/command/dep.rb +1 -6
- data/lib/{podfileDep → core_blur}/command/quick.rb +1 -8
- data/lib/{podfileDep → core_blur}/dep/find.rb +6 -45
- data/lib/{podfileDep → core_blur}/indirect/indirect.rb +1 -9
- data/lib/{podfileDep → core_blur}/modify/modify_code.rb +1 -10
- data/lib/{podfileDep → core_blur}/my_constants.rb +0 -3
- data/lib/{podfileDep → core_blur}/podfilelock.rb +1 -5
- data/lib/{podfileDep → core_blur}/reference/project.rb +1 -26
- data/lib/{podfileDep → core_blur}/reference/unused.rb +1 -8
- data/lib/{podfileDep → core_blur}/thin/installer.rb +1 -49
- data/lib/{podfileDep → core_blur}/thin/local.rb +1 -14
- data/lib/{podfileDep → core_blur}/thin/pod_target.rb +1 -13
- data/lib/{podfileDep → core_blur}/thin/shell.rb +1 -43
- data/lib/core_blur/variable.rb +1 -0
- data/lib/{podfileDep → core_blur}/yaml/yaml_dep.rb +2 -116
- data/lib/{podfileDep → core_blur}/yaml/yaml_pod.rb +1 -6
- data/lib/core_helper.rb +20 -0
- data/lib/podfileDep.rb +8 -21
- data/lib/{podfileDep/version.rb → version.rb} +1 -1
- metadata +34 -40
- data/CHANGELOG.md +0 -178
- data/Gemfile +0 -8
- data/README.md +0 -33
- data/Rakefile +0 -4
- data/docs/Gemfile +0 -9
- data/docs/debug/347/233/256/345/275/225.png +0 -0
- data/docs/debug/351/205/215/347/275/256.png +0 -0
- data/lib/podfileDep/variable.rb +0 -2
- data/podfileDep.gemspec +0 -45
- data/release.sh +0 -6
@@ -1,34 +1,19 @@
|
|
1
1
|
require_relative 'yaml_pod'
|
2
|
-
require_relative '
|
2
|
+
require_relative '../../version'
|
3
3
|
require_relative '../my_constants'
|
4
4
|
require_relative '../check/xcodeproj'
|
5
5
|
require_relative '../variable'
|
6
6
|
require 'colored2'
|
7
7
|
require 'yaml'
|
8
|
-
|
9
8
|
module Pod
|
10
9
|
class YamlDep
|
11
|
-
|
12
|
-
# 主工程target列表
|
13
|
-
# @return [String]
|
14
10
|
attr_accessor :targets
|
15
|
-
|
16
|
-
# 主工程里所有yaml文件定义的依赖
|
17
|
-
# @return {String, {String, [Pod:YamlPod]}}
|
18
11
|
attr_accessor :yaml_deps
|
19
|
-
|
20
|
-
# 解析后生成主工程里所有yaml文件定义的依赖
|
21
|
-
# @return {String, [Pod:YamlPod]}
|
22
12
|
attr_accessor :all_deps
|
23
|
-
|
24
|
-
# 所有的targets对应的依赖库列表
|
25
|
-
# @return {String, [Pod:YamlPod]}
|
26
13
|
attr_accessor :targets_dependencies
|
27
|
-
|
28
14
|
attr_accessor :podfile_local_yaml
|
29
15
|
attr_accessor :podfile_module_yaml
|
30
16
|
attr_accessor :podfile_third_party_yaml
|
31
|
-
|
32
17
|
def initialize
|
33
18
|
super
|
34
19
|
@targets = []
|
@@ -39,17 +24,13 @@ module Pod
|
|
39
24
|
@podfile_module_yaml = MyConstants::PODFILE_MODULE_YAML
|
40
25
|
@podfile_third_party_yaml = MyConstants::PODFILE_THIRD_PARTY_YAML
|
41
26
|
end
|
42
|
-
|
43
27
|
def install_yaml_dep(podfile)
|
44
28
|
analysis_yaml_dep
|
45
|
-
|
46
29
|
install_dependencies(targets_dependencies, podfile) do|name|
|
47
30
|
yield(name) if block_given?
|
48
31
|
end
|
49
32
|
end
|
50
|
-
|
51
33
|
def install_dependencies(targets_dependencies, podfile)
|
52
|
-
# 存储所有的依赖
|
53
34
|
targets_dependencies.each { |target_obj, dependencies|
|
54
35
|
target_name = target_obj.name
|
55
36
|
podfile.target target_name do
|
@@ -65,9 +46,6 @@ module Pod
|
|
65
46
|
}
|
66
47
|
targets
|
67
48
|
end
|
68
|
-
|
69
|
-
# 获取非扩展target定义在yaml文件的依赖
|
70
|
-
# @return targets_dependencies
|
71
49
|
def analysis_yaml_dep
|
72
50
|
init_main_targets
|
73
51
|
generate_yaml
|
@@ -76,7 +54,6 @@ module Pod
|
|
76
54
|
print_yaml_deps
|
77
55
|
resolve_targets_deps
|
78
56
|
end
|
79
|
-
|
80
57
|
def resolve_targets_deps
|
81
58
|
targets.each { |target|
|
82
59
|
if target.product_type.end_with?(".application")
|
@@ -87,22 +64,17 @@ module Pod
|
|
87
64
|
}
|
88
65
|
targets_dependencies
|
89
66
|
end
|
90
|
-
|
91
|
-
# 读取yaml文件的依赖
|
92
67
|
def read_yaml_deps
|
93
68
|
read_yaml_deps_file(podfile_third_party_yaml)
|
94
69
|
read_yaml_deps_file(podfile_module_yaml)
|
95
70
|
read_yaml_deps_file(podfile_local_yaml)
|
96
71
|
end
|
97
|
-
|
98
|
-
# 解析所有的依赖
|
99
72
|
def analyzing_yaml_deps
|
100
73
|
yaml_deps.each do |yaml_name, deps|
|
101
74
|
if yaml_name == podfile_local_yaml
|
102
75
|
clean = false #记录只能清一次就够了
|
103
76
|
deps.each { |name, dep|
|
104
77
|
real_name = name.split("/")[0]
|
105
|
-
# 有子模块 把之前的全部清空
|
106
78
|
if Array(dep.subspecs).size > 0 or Array(dep.configurations).size > 0
|
107
79
|
unless clean
|
108
80
|
all_deps.delete_if{|pod_name|
|
@@ -115,29 +87,22 @@ module Pod
|
|
115
87
|
clean = true
|
116
88
|
end
|
117
89
|
end
|
118
|
-
|
119
90
|
if all_deps.has_key?(name)
|
120
91
|
puts "#{name} 被#{yaml_name}覆盖".green
|
121
92
|
end
|
122
|
-
|
123
93
|
all_deps[name] = dep
|
124
94
|
}
|
125
95
|
else
|
126
96
|
@all_deps.merge!(deps)
|
127
97
|
end
|
128
|
-
|
129
98
|
end
|
130
99
|
all_deps
|
131
100
|
end
|
132
|
-
|
133
101
|
def read_yaml_deps_file(yaml_name)
|
134
|
-
|
135
102
|
yaml_content = read_yaml_content(yaml_name)
|
136
|
-
|
137
103
|
unless yaml_content
|
138
104
|
return
|
139
105
|
end
|
140
|
-
|
141
106
|
if yaml_name != podfile_local_yaml
|
142
107
|
if not yaml_content["SOURCE"] or yaml_content["SOURCE"].class != String
|
143
108
|
puts "#{yaml_name}的SOURCE字段必须是字符串且不为空"
|
@@ -148,45 +113,27 @@ module Pod
|
|
148
113
|
exit!
|
149
114
|
end
|
150
115
|
end
|
151
|
-
|
152
116
|
unless yaml_content["PODS"]
|
153
117
|
puts "#{yaml_name}共0个依赖(文件内的key[PODS]不存在)"
|
154
118
|
return
|
155
119
|
end
|
156
|
-
|
157
120
|
if yaml_content["PODS"].class != Array
|
158
121
|
puts "#{yaml_name}共0个依赖(文件配置的依赖PODS项不是数组或数组为空)"
|
159
122
|
return
|
160
123
|
end
|
161
|
-
|
162
|
-
# 读取默认源码source
|
163
124
|
default_source_source = yaml_content['SOURCE']
|
164
|
-
|
165
|
-
# 读取默认二进制source
|
166
125
|
default_binary_source = yaml_content['BINARY_SOURCE']
|
167
|
-
|
168
|
-
# 依赖列表
|
169
126
|
dependencies_pods = yaml_content['PODS']
|
170
|
-
|
171
|
-
# 当前yaml文件的组件名字 用来校验本文件内是否重复
|
172
127
|
dependencies_name = []
|
173
|
-
|
174
128
|
yaml_dependencies = {}
|
175
|
-
|
176
|
-
# 遍历依赖库列表
|
177
129
|
dependencies_pods.each { |dependency|
|
178
|
-
|
179
130
|
check_pod(dependency, yaml_name, dependencies_name)
|
180
|
-
|
181
|
-
# 默认值
|
182
131
|
source = dependency['source']
|
183
132
|
unless source
|
184
133
|
source = dependency['binary'] ? default_binary_source : default_source_source
|
185
134
|
end
|
186
135
|
inhibit_warnings = dependency['inhibit_warnings'] ? !!dependency['inhibit_warnings'] : false
|
187
136
|
binary = dependency['binary'] ? !!dependency['binary'] : true
|
188
|
-
|
189
|
-
# configurations和subspecs cocoapods不能同时支持,所以要展开
|
190
137
|
if Array(dependency['subspecs']).size > 0 and Array(dependency['configurations']).size > 0
|
191
138
|
dependency['subspecs'].each {|subspec|
|
192
139
|
dep = YamlPod.new(pod = "#{dependency['pod']}/#{subspec}")
|
@@ -204,7 +151,6 @@ module Pod
|
|
204
151
|
dep.binary = binary
|
205
152
|
yaml_dependencies[dep.pod] = dep
|
206
153
|
}
|
207
|
-
|
208
154
|
else
|
209
155
|
dep = YamlPod.new(pod = dependency['pod'])
|
210
156
|
dep.module_name = dependency['module']
|
@@ -222,14 +168,10 @@ module Pod
|
|
222
168
|
yaml_dependencies[dep.pod] = dep
|
223
169
|
end
|
224
170
|
}
|
225
|
-
|
226
171
|
yaml_deps[yaml_name] = yaml_dependencies
|
227
|
-
|
228
172
|
yaml_dependencies
|
229
173
|
end
|
230
|
-
|
231
174
|
def check_pod(dependency, yaml_name, dependencies_name)
|
232
|
-
# 不支持提醒
|
233
175
|
available_keys = %w[module pod subspecs path podspec version git tag branch configurations inhibit_warnings source binary]
|
234
176
|
dependency.each_key { |key|
|
235
177
|
unless available_keys.include?(key)
|
@@ -240,25 +182,20 @@ module Pod
|
|
240
182
|
exit!
|
241
183
|
end
|
242
184
|
}
|
243
|
-
|
244
|
-
# 校验字段
|
245
185
|
unless dependency['pod']
|
246
186
|
puts "#{yaml_name}: pod 字段(组件名字)必须存在,请检查:"
|
247
187
|
exit!
|
248
188
|
end
|
249
|
-
|
250
189
|
current_type = nil
|
251
190
|
current_type = check_only_one_dep(dependency, "path", current_type, yaml_name)
|
252
191
|
current_type = check_only_one_dep(dependency, "podspec", current_type, yaml_name)
|
253
192
|
current_type = check_only_one_dep(dependency, "version", current_type, yaml_name)
|
254
193
|
current_type = check_only_one_dep(dependency, "tag", current_type, yaml_name)
|
255
194
|
current_type = check_only_one_dep(dependency, "branch", current_type, yaml_name)
|
256
|
-
|
257
195
|
unless current_type
|
258
196
|
puts "#{yaml_name} - #{dependency['pod']}: path/podspec/version/git/tag/branch 字段请指定其中一个"
|
259
197
|
exit!
|
260
198
|
end
|
261
|
-
|
262
199
|
unless dependency['git']
|
263
200
|
if dependency['tag']
|
264
201
|
puts "#{yaml_name} - #{dependency['pod']}: 你指定了tag,但未配置git地址,请为此组件配置git字段"
|
@@ -269,36 +206,27 @@ module Pod
|
|
269
206
|
exit!
|
270
207
|
end
|
271
208
|
end
|
272
|
-
|
273
|
-
# 检查数据类型
|
274
209
|
if dependency['configurations'] and dependency['configurations'].class != Array
|
275
210
|
puts "#{yaml_name} - #{dependency['pod']} - #{dependency['configurations']}: configurations字段必须是数组,例如:['Debug','Release']"
|
276
211
|
exit!
|
277
212
|
end
|
278
|
-
|
279
213
|
if dependency['subspecs'] and dependency['subspecs'].class != Array
|
280
214
|
puts "#{yaml_name} - #{dependency['pod']} - #{dependency['subspecs']}: subspecs字段必须是数组,例如:['A','B','C']"
|
281
215
|
exit!
|
282
216
|
end
|
283
|
-
|
284
|
-
# 校验自身文件重复
|
285
217
|
if dependencies_name.include?(dependency['pod'])
|
286
218
|
puts "❌ 发现#{yaml_name}内重复组件:#{dependency['pod']},请检查并删除重复依赖:".red
|
287
219
|
exit!
|
288
220
|
else
|
289
221
|
dependencies_name << dependency['pod']
|
290
222
|
end
|
291
|
-
|
292
|
-
# 警告
|
293
223
|
if dependency['path'] and yaml_name != podfile_local_yaml
|
294
224
|
warn "⚠️ 组件#{dependency['pod']}使用path依赖方式应该写在#{podfile_local_yaml}".yellow
|
295
225
|
end
|
296
226
|
if dependency['podspec'] and yaml_name != podfile_local_yaml
|
297
227
|
warn "⚠️ 组件#{dependency['pod']}使用podspec依赖方式应该写在#{podfile_local_yaml}".yellow
|
298
228
|
end
|
299
|
-
|
300
229
|
end
|
301
|
-
|
302
230
|
def check_only_one_dep(dependency, key, current_type, yaml_name)
|
303
231
|
if dependency[key]
|
304
232
|
if current_type
|
@@ -310,13 +238,11 @@ module Pod
|
|
310
238
|
end
|
311
239
|
current_type
|
312
240
|
end
|
313
|
-
|
314
241
|
def read_yaml_content(yaml_name)
|
315
242
|
unless File.exist?(yaml_name)
|
316
243
|
puts "文件不存在:"+yaml_name
|
317
244
|
return nil
|
318
245
|
end
|
319
|
-
|
320
246
|
begin
|
321
247
|
yaml_content = YAML.load_file(yaml_name)
|
322
248
|
rescue Exception => e
|
@@ -324,21 +250,17 @@ module Pod
|
|
324
250
|
puts yaml_name+'文件解析异常, 请检查 ⬆️'
|
325
251
|
exit!
|
326
252
|
end
|
327
|
-
|
328
253
|
unless yaml_content.class == Hash
|
329
254
|
puts "#{yaml_name} => (文件不是keyValue形式)"
|
330
255
|
return nil
|
331
256
|
end
|
332
|
-
|
333
257
|
yaml_content
|
334
258
|
end
|
335
|
-
|
336
259
|
def print_yaml_deps
|
337
260
|
yaml_deps.each do |yaml_name, deps|
|
338
261
|
puts "读取#{yaml_name} => #{deps.size}个"
|
339
262
|
end
|
340
263
|
puts "➡️ 解析后依赖总数共计:#{all_deps.size}个\n"
|
341
|
-
|
342
264
|
sort_deps = all_deps.sort do |arr1, arr2|
|
343
265
|
dep1 = arr1[1]
|
344
266
|
dep2 = arr2[1]
|
@@ -348,13 +270,11 @@ module Pod
|
|
348
270
|
dep1.pod.downcase <=> dep2.pod.downcase
|
349
271
|
end
|
350
272
|
end
|
351
|
-
|
352
273
|
puts '⬇️ 打印依赖'
|
353
274
|
current_dir = Dir.pwd
|
354
275
|
sort_deps.each { |sort_dep|
|
355
276
|
dependency = sort_dep[1]
|
356
277
|
puts_result = "pod '#{dependency.pod}'"
|
357
|
-
|
358
278
|
if dependency.path #路径引用
|
359
279
|
puts_result += ", :path => '#{dependency.path}'"
|
360
280
|
elsif dependency.podspec #podspec引用
|
@@ -369,7 +289,6 @@ module Pod
|
|
369
289
|
puts_result += ", :branch => '#{dependency.branch}'"
|
370
290
|
end
|
371
291
|
end
|
372
|
-
|
373
292
|
if dependency.configurations
|
374
293
|
puts_result += ", :configurations => ['#{dependency.configurations.join("','")}']"
|
375
294
|
end
|
@@ -382,71 +301,55 @@ module Pod
|
|
382
301
|
if dependency.version and dependency.source
|
383
302
|
puts_result += ", :source => '#{dependency.source}'"
|
384
303
|
end
|
385
|
-
|
386
304
|
if dependency.path
|
387
305
|
branch = repo_branch(dependency.path)
|
388
306
|
modify = repo_modify(dependency.path)
|
389
307
|
puts puts_result.cyan + branch.magenta + modify.magenta
|
390
|
-
|
391
308
|
elsif dependency.branch
|
392
309
|
puts puts_result.yellow
|
393
310
|
else
|
394
311
|
puts puts_result
|
395
312
|
end
|
396
|
-
|
397
313
|
}
|
398
314
|
Dir.chdir(current_dir)
|
399
315
|
puts "⬆️ 打印完毕"
|
400
316
|
end
|
401
|
-
|
402
|
-
# 生成默认yaml文件
|
403
317
|
def generate_yaml
|
404
318
|
generate_local_yaml(podfile_local_yaml)
|
405
319
|
generate_module_yaml(podfile_module_yaml, "# 企业内部组件")
|
406
320
|
generate_module_yaml(podfile_third_party_yaml, "# 第三方维护组件")
|
407
321
|
end
|
408
|
-
|
409
322
|
def generate_local_yaml(podfile_local_yaml)
|
410
323
|
if File.exist?(podfile_local_yaml)
|
411
324
|
return
|
412
325
|
end
|
413
326
|
puts "生成#{podfile_local_yaml}文件"
|
414
|
-
|
415
327
|
content = ""
|
416
328
|
content = content + "# 1、本依赖配置文件优先级最高, 用来覆盖其他两个依赖的yaml文件中的组件。 尝试打开以下注释, 修改对应字段, 然后执行pod install\n"
|
417
329
|
content = content + "# 2、PODS下边的配置是数组形式, 如果有多个就写多个(subspecs需要数组)\n"
|
418
330
|
content = content + "# 3、本文件加入到忽略文件中\n\n"
|
419
|
-
|
420
331
|
content = content + "# QUICK_BUILD字段如果为true, 则表示会自动解析所有组件的依赖, 并删除不被使用的依赖库, 以达到开发时快速编译的目的\n"
|
421
332
|
content = content + "QUICK_BUILD: false\n\n"
|
422
|
-
|
423
333
|
content = content + "PODS:\n"
|
424
|
-
|
425
334
|
content = content + "\n"
|
426
|
-
|
427
335
|
content = content + "# - module: Masonry\n"
|
428
336
|
content = content + "# pod: Masonry\n"
|
429
337
|
content = content + "# subspecs: null\n"
|
430
338
|
content = content + "# path: ~/MasonryCodePath\n"
|
431
|
-
|
432
339
|
content = content + "\n"
|
433
|
-
|
434
340
|
content = content + "# - module: MJExtension\n"
|
435
341
|
content = content + "# pod: MJExtension\n"
|
436
342
|
content = content + "# subspecs: null\n"
|
437
343
|
content = content + "# path: ~/MJExtensionCodePath\n"
|
438
|
-
|
439
344
|
File.open(podfile_local_yaml, 'w') { |file|
|
440
345
|
file.write(content)
|
441
346
|
}
|
442
347
|
end
|
443
|
-
|
444
348
|
def generate_module_yaml(yaml_name, prefix)
|
445
349
|
if File.exist?(yaml_name)
|
446
350
|
return
|
447
351
|
end
|
448
352
|
puts "生成#{yaml_name}文件"
|
449
|
-
|
450
353
|
content = ""
|
451
354
|
content = content + prefix
|
452
355
|
content = content + "\n"
|
@@ -475,13 +378,10 @@ module Pod
|
|
475
378
|
content = content + "# inhibit_warnings: true\n"
|
476
379
|
content = content + "# source: null\n"
|
477
380
|
content = content + "# binary: true\n"
|
478
|
-
|
479
381
|
File.open(yaml_name, 'w') { |file|
|
480
382
|
file.write(content)
|
481
383
|
}
|
482
384
|
end
|
483
|
-
|
484
|
-
# 获取某个目录下的当前分支
|
485
385
|
def repo_branch(path)
|
486
386
|
full_path = File.expand_path(path)
|
487
387
|
git_path = "#{full_path}/.git"
|
@@ -492,44 +392,33 @@ module Pod
|
|
492
392
|
unless File.exist?(head_path)
|
493
393
|
return ""
|
494
394
|
end
|
495
|
-
|
496
395
|
content = File.read(head_path)
|
497
396
|
content = content.gsub("\n", "")
|
498
|
-
|
499
397
|
branch_key_word = "ref: refs/heads/"
|
500
398
|
if content.include?(branch_key_word)
|
501
399
|
branch = content.gsub(branch_key_word, "")
|
502
400
|
return "(#{branch})"
|
503
401
|
end
|
504
|
-
|
505
402
|
if content.size >= 8
|
506
403
|
short_sha = content.slice(0, 7)
|
507
404
|
return "(#{short_sha})"
|
508
405
|
end
|
509
|
-
|
510
406
|
" #(#{content})"
|
511
407
|
end
|
512
|
-
|
513
|
-
# 获取仓库状态是否有修改
|
514
408
|
def repo_modify(path)
|
515
409
|
full_path = File.expand_path(path)
|
516
410
|
git_path = "#{full_path}/.git"
|
517
411
|
unless Dir.exist?(git_path)
|
518
412
|
return ""
|
519
413
|
end
|
520
|
-
|
521
414
|
Dir.chdir(full_path)
|
522
415
|
status = %x(git status -suno)
|
523
416
|
status.size > 0 ? "[modified]" : ""
|
524
417
|
end
|
525
|
-
|
526
|
-
# 读取主工程target列表
|
527
418
|
def init_main_targets
|
528
419
|
project_manager = XCProject::XcodeprojManager.share_manager
|
529
420
|
@targets = project_manager.get_app_targets
|
530
421
|
end
|
531
|
-
|
532
|
-
#是否开启了编译优化开关
|
533
422
|
def quick_build
|
534
423
|
yaml_content = read_yaml_content(podfile_local_yaml)
|
535
424
|
if $quick_build != nil
|
@@ -537,8 +426,6 @@ module Pod
|
|
537
426
|
end
|
538
427
|
yaml_content ? !!(yaml_content["QUICK_BUILD"]) : false
|
539
428
|
end
|
540
|
-
|
541
|
-
#是否禁用检查podspec文件
|
542
429
|
def disable_check_podspec
|
543
430
|
yaml_content = read_yaml_content(podfile_local_yaml)
|
544
431
|
disable_check_podspec = yaml_content ? !!(yaml_content["DISABLE_CHECK_PODSPEC"]) : false
|
@@ -547,6 +434,5 @@ module Pod
|
|
547
434
|
end
|
548
435
|
disable_check_podspec
|
549
436
|
end
|
550
|
-
|
551
437
|
end
|
552
|
-
end
|
438
|
+
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
module Pod
|
2
2
|
class YamlPod
|
3
|
-
|
4
3
|
def initialize(pod)
|
5
4
|
@pod = pod
|
6
5
|
end
|
7
|
-
|
8
6
|
attr_accessor :module_name
|
9
7
|
attr_accessor :pod
|
10
8
|
attr_accessor :subspecs
|
@@ -19,12 +17,10 @@ module Pod
|
|
19
17
|
attr_accessor :source
|
20
18
|
attr_accessor :binary
|
21
19
|
attr_reader :type
|
22
|
-
|
23
20
|
def option
|
24
21
|
result = {:configurations => self.configurations,
|
25
22
|
:inhibit_warnings => self.inhibit_warnings,
|
26
23
|
:subspecs => self.subspecs}
|
27
|
-
|
28
24
|
if self.path #路径依赖
|
29
25
|
result[:path] = self.path
|
30
26
|
elsif self.podspec #podspec引用
|
@@ -41,7 +37,6 @@ module Pod
|
|
41
37
|
end
|
42
38
|
result
|
43
39
|
end
|
44
|
-
|
45
40
|
def type
|
46
41
|
if self.path
|
47
42
|
0
|
@@ -58,4 +53,4 @@ module Pod
|
|
58
53
|
end
|
59
54
|
end
|
60
55
|
end
|
61
|
-
end
|
56
|
+
end
|
data/lib/core_helper.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Core
|
4
|
+
class CoreHelper
|
5
|
+
def self.core_path
|
6
|
+
|
7
|
+
origin_exist = Dir.exist?("#{__dir__}/core")
|
8
|
+
blur_exist = Dir.exist?("#{__dir__}/core_blur")
|
9
|
+
core_path = nil
|
10
|
+
if origin_exist
|
11
|
+
core_path = "core"
|
12
|
+
elsif blur_exist
|
13
|
+
core_path = "core_blur"
|
14
|
+
else
|
15
|
+
puts "❌ 引用错误, 请检查"
|
16
|
+
end
|
17
|
+
core_path
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/podfileDep.rb
CHANGED
@@ -1,22 +1,20 @@
|
|
1
|
-
|
2
|
-
require_relative 'podfileDep/version'
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
|
3
|
+
require_relative 'core_helper'
|
4
|
+
require_relative 'version'
|
5
|
+
core_path = Core::CoreHelper.core_path
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
if yaml_dep.quick_build
|
9
|
-
require_relative 'podfileDep/thin/installer'
|
10
|
-
end
|
7
|
+
require_relative "#{core_path}/yaml/yaml_dep"
|
11
8
|
|
9
|
+
yaml_dep = Pod::YamlDep.new
|
10
|
+
if yaml_dep.quick_build
|
11
|
+
require_relative "#{core_path}/thin/installer"
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
14
|
module Pod
|
16
15
|
class Podfile
|
17
16
|
def yaml_dep!
|
18
17
|
|
19
|
-
# 加入插件
|
20
18
|
plugin("podfileDep")
|
21
19
|
|
22
20
|
yam_dep = YamlDep.new
|
@@ -29,15 +27,4 @@ module Pod
|
|
29
27
|
end
|
30
28
|
end
|
31
29
|
|
32
|
-
# 兼容旧的方式
|
33
|
-
module PodfileDep
|
34
|
-
def PodfileDep.setup(targets)
|
35
|
-
yam_dep = Pod::YamlDep.new
|
36
|
-
res = yam_dep.analysis_yaml_dep
|
37
|
-
warn "\n⚠️ [PodfileDep.setup方法已过期],请使用新的方式, 参考:https://gitee.com/sourceiOS/podfileDepDemo/blob/master/Podfile\n"
|
38
|
-
res
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
42
|
-
|
43
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: podfileDep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- wsp
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|
@@ -65,48 +65,42 @@ executables: []
|
|
65
65
|
extensions: []
|
66
66
|
extra_rdoc_files: []
|
67
67
|
files:
|
68
|
-
-
|
69
|
-
-
|
70
|
-
- README.md
|
71
|
-
- Rakefile
|
72
|
-
- docs/Gemfile
|
73
|
-
- docs/debug目录.png
|
74
|
-
- docs/debug配置.png
|
68
|
+
- bin/console
|
69
|
+
- bin/setup
|
75
70
|
- lib/cocoapods_plugin.rb
|
71
|
+
- lib/core_blur/check/import.rb
|
72
|
+
- lib/core_blur/check/item.rb
|
73
|
+
- lib/core_blur/check/podspec.rb
|
74
|
+
- lib/core_blur/check/project.rb
|
75
|
+
- lib/core_blur/check/util.rb
|
76
|
+
- lib/core_blur/check/xcodeproj.rb
|
77
|
+
- lib/core_blur/command/all.rb
|
78
|
+
- lib/core_blur/command/dep.rb
|
79
|
+
- lib/core_blur/command/quick.rb
|
80
|
+
- lib/core_blur/dep/find.rb
|
81
|
+
- lib/core_blur/indirect/indirect.rb
|
82
|
+
- lib/core_blur/modify/modify_code.rb
|
83
|
+
- lib/core_blur/my_constants.rb
|
84
|
+
- lib/core_blur/podfilelock.rb
|
85
|
+
- lib/core_blur/reference/project.rb
|
86
|
+
- lib/core_blur/reference/unused.rb
|
87
|
+
- lib/core_blur/thin/installer.rb
|
88
|
+
- lib/core_blur/thin/local.rb
|
89
|
+
- lib/core_blur/thin/pod_target.rb
|
90
|
+
- lib/core_blur/thin/shell.rb
|
91
|
+
- lib/core_blur/variable.rb
|
92
|
+
- lib/core_blur/yaml/yaml_dep.rb
|
93
|
+
- lib/core_blur/yaml/yaml_pod.rb
|
94
|
+
- lib/core_helper.rb
|
76
95
|
- lib/podfileDep.rb
|
77
|
-
- lib/
|
78
|
-
- lib/podfileDep/check/item.rb
|
79
|
-
- lib/podfileDep/check/podspec.rb
|
80
|
-
- lib/podfileDep/check/project.rb
|
81
|
-
- lib/podfileDep/check/util.rb
|
82
|
-
- lib/podfileDep/check/xcodeproj.rb
|
83
|
-
- lib/podfileDep/command/all.rb
|
84
|
-
- lib/podfileDep/command/dep.rb
|
85
|
-
- lib/podfileDep/command/quick.rb
|
86
|
-
- lib/podfileDep/dep/find.rb
|
87
|
-
- lib/podfileDep/indirect/indirect.rb
|
88
|
-
- lib/podfileDep/modify/modify_code.rb
|
89
|
-
- lib/podfileDep/my_constants.rb
|
90
|
-
- lib/podfileDep/podfilelock.rb
|
91
|
-
- lib/podfileDep/reference/project.rb
|
92
|
-
- lib/podfileDep/reference/unused.rb
|
93
|
-
- lib/podfileDep/thin/installer.rb
|
94
|
-
- lib/podfileDep/thin/local.rb
|
95
|
-
- lib/podfileDep/thin/pod_target.rb
|
96
|
-
- lib/podfileDep/thin/shell.rb
|
97
|
-
- lib/podfileDep/variable.rb
|
98
|
-
- lib/podfileDep/version.rb
|
99
|
-
- lib/podfileDep/yaml/yaml_dep.rb
|
100
|
-
- lib/podfileDep/yaml/yaml_pod.rb
|
101
|
-
- podfileDep.gemspec
|
102
|
-
- release.sh
|
96
|
+
- lib/version.rb
|
103
97
|
homepage: https://gitee.com/sourceiOS/podfileDepDemo
|
104
98
|
licenses: []
|
105
99
|
metadata:
|
106
100
|
homepage_uri: https://gitee.com/sourceiOS/podfileDepDemo
|
107
101
|
source_code_uri: https://gitee.com/sourceiOS/podfileDep
|
108
102
|
changelog_uri: https://gitee.com/sourceiOS/podfileDep
|
109
|
-
post_install_message:
|
103
|
+
post_install_message:
|
110
104
|
rdoc_options: []
|
111
105
|
require_paths:
|
112
106
|
- lib
|
@@ -121,8 +115,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
115
|
- !ruby/object:Gem::Version
|
122
116
|
version: '0'
|
123
117
|
requirements: []
|
124
|
-
rubygems_version: 3.4.
|
125
|
-
signing_key:
|
118
|
+
rubygems_version: 3.4.1
|
119
|
+
signing_key:
|
126
120
|
specification_version: 4
|
127
121
|
summary: iOS端 依赖库使用yaml文件管理
|
128
122
|
test_files: []
|