podfileDep 2.3.3 → 2.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/podfileDep/version.rb +1 -1
- data/lib/podfileDep/yaml/yaml_dep.rb +45 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d0616ba675d61a7cb9f12f36c98e0b313c8f87e3ba17ded2f7dbcfde9265af4
|
4
|
+
data.tar.gz: df8fe42f9b709d4c31405b97ce26b4b7f2ae82f794cf58ceb4e0095b83fda21b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99ccba32f897f779b649f1c9c61377ecd882907f64cb05da41e10a80df074dae579904d49e1730e4ec18a1e81fa0fd79c88a2c380a6bf7c9fbda709d0ede0bdf
|
7
|
+
data.tar.gz: 5059a3d938a77b8bb479500c842ec903cabd6659a51b5b0d47cb0ea04e3e3be4dda89a46c88b21986245b1e275e4a2b42ee1804cc61a3e40f4f6af9ca4ad9ed8
|
data/CHANGELOG.md
CHANGED
data/lib/podfileDep/version.rb
CHANGED
@@ -333,12 +333,26 @@ module Pod
|
|
333
333
|
end
|
334
334
|
puts "➡️ 解析后依赖总数共计:#{all_deps.size}个\n"
|
335
335
|
|
336
|
+
sort_deps = all_deps.sort do |arr1, arr2|
|
337
|
+
dep1 = arr1[1]
|
338
|
+
dep2 = arr2[1]
|
339
|
+
if dep1.path and not dep2.path
|
340
|
+
1
|
341
|
+
elsif not dep1.path and dep2.path
|
342
|
+
-1
|
343
|
+
else
|
344
|
+
dep1.pod.downcase <=> dep2.pod.downcase
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
336
348
|
puts '⬇️ 打印依赖'
|
337
|
-
|
349
|
+
sort_deps.each { |sort_dep|
|
350
|
+
dependency = sort_dep[1]
|
338
351
|
puts_result = "pod '#{dependency.pod}'"
|
339
352
|
|
340
353
|
if dependency.path #路径引用
|
341
|
-
|
354
|
+
branch = repo_branch(dependency.path)
|
355
|
+
puts_result += ", :path => '#{dependency.path}'#{branch}"
|
342
356
|
elsif dependency.podspec #podspec引用
|
343
357
|
puts_result += ", :podspec => '#{dependency.podspec}'"
|
344
358
|
elsif dependency.version #版本号引用
|
@@ -457,6 +471,35 @@ module Pod
|
|
457
471
|
}
|
458
472
|
end
|
459
473
|
|
474
|
+
# 获取某个目录下的当前分支
|
475
|
+
def repo_branch(path)
|
476
|
+
full_path = File.expand_path(path)
|
477
|
+
git_path = "#{full_path}/.git"
|
478
|
+
unless Dir.exist?(git_path)
|
479
|
+
return ""
|
480
|
+
end
|
481
|
+
head_path = "#{git_path}/HEAD"
|
482
|
+
unless File.exist?(head_path)
|
483
|
+
return ""
|
484
|
+
end
|
485
|
+
|
486
|
+
content = File.read(head_path)
|
487
|
+
content = content.gsub("\n", "")
|
488
|
+
|
489
|
+
branch_key_word = "ref: refs/heads/"
|
490
|
+
if content.include?(branch_key_word)
|
491
|
+
branch = content.gsub(branch_key_word, "")
|
492
|
+
return "(#{branch})"
|
493
|
+
end
|
494
|
+
|
495
|
+
if content.size >= 8
|
496
|
+
short_sha = content.slice(0, 7)
|
497
|
+
return "(#{short_sha})"
|
498
|
+
end
|
499
|
+
|
500
|
+
"(#{content})"
|
501
|
+
end
|
502
|
+
|
460
503
|
# 读取主工程target列表
|
461
504
|
def init_main_targets
|
462
505
|
project_manager = XCProject::XcodeprojManager.share_manager
|