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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 491f4a383b768a448297d15aa5fc6d1a20579e45ddf1deba7c1f692c72f6505a
4
- data.tar.gz: a5c91fe5e5e5453905ea83ca0a8c51a510c81478f3386c93ee32c79c7a74a6f7
3
+ metadata.gz: 8d0616ba675d61a7cb9f12f36c98e0b313c8f87e3ba17ded2f7dbcfde9265af4
4
+ data.tar.gz: df8fe42f9b709d4c31405b97ce26b4b7f2ae82f794cf58ceb4e0095b83fda21b
5
5
  SHA512:
6
- metadata.gz: bb54718fa3fd8b876793a5e9c2d0b8638aaf8c7a7b4481357f9bd9d030732da9cb52947ac6a1128f8f4ad41d2d7c73efffe94553f53dcdf896379941eaf32a2c
7
- data.tar.gz: 864acce6a07eda525076f9397d6ad815b337b435a91681e7efcee9c206379b85dcf8cf85b6b419c31cf27c8c759f1881f971963d0c0b20181d951331c8f538d8
6
+ metadata.gz: 99ccba32f897f779b649f1c9c61377ecd882907f64cb05da41e10a80df074dae579904d49e1730e4ec18a1e81fa0fd79c88a2c380a6bf7c9fbda709d0ede0bdf
7
+ data.tar.gz: 5059a3d938a77b8bb479500c842ec903cabd6659a51b5b0d47cb0ea04e3e3be4dda89a46c88b21986245b1e275e4a2b42ee1804cc61a3e40f4f6af9ca4ad9ed8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Released]
2
2
 
3
+ ### [2.3.4] - 2023-7-24
4
+ - pod依赖打印排序
5
+ - pod依赖打印路径依赖时增加打印分支名
6
+
3
7
  ### [2.3.3] - 2023-7-24
4
8
  - import规范检查逻辑优化
5
9
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PodfileDep
4
- VERSION = "2.3.3"
4
+ VERSION = "2.3.4"
5
5
  end
@@ -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
- all_deps.each_value { |dependency|
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
- puts_result += ", :path => '#{dependency.path}'"
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podfileDep
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.3
4
+ version: 2.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - 王帅朋