cocoapods-jxedt 0.0.12 → 0.0.13

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.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cocoapods-jxedt/binary/Intergation.rb +18 -13
  3. data/lib/cocoapods-jxedt/binary/config.rb +62 -0
  4. data/lib/cocoapods-jxedt/binary/helper/podfile_post_install_hook.rb +29 -0
  5. data/lib/cocoapods-jxedt/binary/hooks/CocoapodsJxedtHook.rb +6 -9
  6. data/lib/cocoapods-jxedt/binary/hooks/post_install.rb +2 -2
  7. data/lib/cocoapods-jxedt/binary/hooks/pre_install.rb +30 -10
  8. data/lib/cocoapods-jxedt/binary/main.rb +1 -0
  9. data/lib/cocoapods-jxedt/binary/pod-room/framework.rb +40 -0
  10. data/lib/cocoapods-jxedt/binary/pod-room/xcodebuild_command.rb +79 -1
  11. data/lib/cocoapods-jxedt/binary/pod-room/xcodebuild_raw.rb +1 -1
  12. data/lib/cocoapods-jxedt/binary/prebuild.rb +92 -14
  13. data/lib/cocoapods-jxedt/command/binary/binary.rb +36 -0
  14. data/lib/cocoapods-jxedt/command/binary/command/build.rb +84 -0
  15. data/lib/cocoapods-jxedt/command/binary/command/clean.rb +101 -0
  16. data/lib/cocoapods-jxedt/command/binary/command/fetch.rb +36 -0
  17. data/lib/cocoapods-jxedt/command/binary/command/push.rb +41 -0
  18. data/lib/cocoapods-jxedt/command/binary/command/statistics.rb +104 -0
  19. data/lib/cocoapods-jxedt/command/jxedt.rb +1 -1
  20. data/lib/cocoapods-jxedt/command/options/options.rb +85 -2
  21. data/lib/cocoapods-jxedt/gem_version.rb +1 -1
  22. data/lib/cocoapods-jxedt/git_helper/cache_fetcher.rb +34 -0
  23. data/lib/cocoapods-jxedt/git_helper/cache_pucher.rb +42 -0
  24. data/lib/cocoapods-jxedt/git_helper/git_command.rb +48 -0
  25. data/lib/cocoapods-jxedt/git_helper/zip.rb +22 -0
  26. metadata +14 -3
  27. data/lib/cocoapods-jxedt/command/statistics/statistics.rb +0 -98
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-jxedt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - guojiashuang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-23 00:00:00.000000000 Z
11
+ date: 2023-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods
@@ -75,23 +75,34 @@ files:
75
75
  - lib/cocoapods-jxedt/binary/config.rb
76
76
  - lib/cocoapods-jxedt/binary/helper/names.rb
77
77
  - lib/cocoapods-jxedt/binary/helper/podfile_options.rb
78
+ - lib/cocoapods-jxedt/binary/helper/podfile_post_install_hook.rb
78
79
  - lib/cocoapods-jxedt/binary/helper/prebuild_sandbox.rb
79
80
  - lib/cocoapods-jxedt/binary/helper/target_definition.rb
80
81
  - lib/cocoapods-jxedt/binary/hooks/CocoapodsJxedtHook.rb
81
82
  - lib/cocoapods-jxedt/binary/hooks/post_install.rb
82
83
  - lib/cocoapods-jxedt/binary/hooks/pre_install.rb
83
84
  - lib/cocoapods-jxedt/binary/main.rb
85
+ - lib/cocoapods-jxedt/binary/pod-room/framework.rb
84
86
  - lib/cocoapods-jxedt/binary/pod-room/xcodebuild_command.rb
85
87
  - lib/cocoapods-jxedt/binary/pod-room/xcodebuild_raw.rb
86
88
  - lib/cocoapods-jxedt/binary/podfile_dsl.rb
87
89
  - lib/cocoapods-jxedt/binary/prebuild.rb
88
90
  - lib/cocoapods-jxedt/binary/targets/pod_target.rb
89
91
  - lib/cocoapods-jxedt/command.rb
92
+ - lib/cocoapods-jxedt/command/binary/binary.rb
93
+ - lib/cocoapods-jxedt/command/binary/command/build.rb
94
+ - lib/cocoapods-jxedt/command/binary/command/clean.rb
95
+ - lib/cocoapods-jxedt/command/binary/command/fetch.rb
96
+ - lib/cocoapods-jxedt/command/binary/command/push.rb
97
+ - lib/cocoapods-jxedt/command/binary/command/statistics.rb
90
98
  - lib/cocoapods-jxedt/command/header/header.rb
91
99
  - lib/cocoapods-jxedt/command/jxedt.rb
92
100
  - lib/cocoapods-jxedt/command/options/options.rb
93
- - lib/cocoapods-jxedt/command/statistics/statistics.rb
94
101
  - lib/cocoapods-jxedt/gem_version.rb
102
+ - lib/cocoapods-jxedt/git_helper/cache_fetcher.rb
103
+ - lib/cocoapods-jxedt/git_helper/cache_pucher.rb
104
+ - lib/cocoapods-jxedt/git_helper/git_command.rb
105
+ - lib/cocoapods-jxedt/git_helper/zip.rb
95
106
  - lib/cocoapods-jxedt/tool.rb
96
107
  - lib/cocoapods_plugin.rb
97
108
  homepage: http://igit.58corp.com/com.wuba.jxedt.ios/cocoapods-jxedt
@@ -1,98 +0,0 @@
1
- module Pod
2
- class Command
3
- class JxedtCommand < Command
4
- class Statistics < JxedtCommand
5
- self.summary = '统计二进制使用情况'
6
- self.description = <<-DESC
7
- 统计二进制使用详情
8
- DESC
9
- self.command = 'statistics'
10
- self.arguments = [
11
- ]
12
- def self.options
13
- [
14
- ['--failed', '统计校验失败的二进制'],
15
- ]
16
- end
17
- def initialize(argv)
18
- @check_failed = argv.flag?('failed')
19
- super
20
- end
21
-
22
- def validate!
23
- super
24
- end
25
-
26
- def run
27
- podfile = Pod::Config.instance.podfile
28
- lockfile = Pod::Config.instance.lockfile
29
- help! '请检查命令执行路径,需要在Podfile文件所在目录执行' if podfile.nil? || lockfile.nil?
30
-
31
- require 'cocoapods-jxedt/binary/config'
32
- require 'cocoapods-jxedt/binary/helper/podfile_options'
33
-
34
- pods_root = Pathname.new(File.dirname(podfile.defined_in_file)) + "Pods"
35
- binary_dir = pods_root + Jxedt.config.binary_dir
36
-
37
- used_binary = []
38
- Dir.glob("#{pods_root}/*/_Prebuild") do |file_path|
39
- next unless File.directory?(file_path)
40
- dir_name = File.dirname(file_path)
41
- name = File.basename(dir_name).to_s
42
- target_path = binary_dir + name
43
- next unless target_path.exist? # 路径不存在,跳过
44
-
45
- new_hash = {}
46
- # name
47
- new_hash[:name] = name
48
-
49
- # multiple_configuration
50
- configuration_enable = target_path.children().select { |path| "#{path.basename}" == 'Debug' || "#{path.basename}" == 'Release' }.count == 2
51
- new_hash[:multiple_configuration] = configuration_enable
52
-
53
- # checksum validation
54
- checksum_file = target_path.children().select { |path| path.extname == '.checksum' }.first
55
- new_hash[:checksum] = checksum_file.basename.to_s.gsub('.checksum', '') unless checksum_file.nil?
56
-
57
- used_binary << new_hash
58
- end
59
-
60
- # print
61
- index, failed = 0, []
62
- used_binary.sort_by {|hash| hash[:name].capitalize }.each do |hash|
63
- name = hash[:name]
64
-
65
- checksum = lockfile.spec_checksums_hash_key(name)
66
- validation_passed = checksum && checksum == hash[:checksum]
67
- failed << name unless validation_passed
68
-
69
- # 校验和是否用的 git commitid
70
- checkout_options = lockfile.internal_data["CHECKOUT OPTIONS"] || {}
71
- is_git_commitid = checkout_options[name] && checkout_options[name][:commit]
72
-
73
- if validation_passed
74
- next if @check_failed
75
- index += 1
76
- log = <<~LOG
77
- #{index}). #{name}:
78
- multiple configuration: #{hash[:multiple_configuration]}
79
- checksum#{"(git commitid)" if is_git_commitid}: #{hash[:checksum]}
80
- LOG
81
- Pod::UI.puts log
82
- else
83
- index += 1
84
- log = <<~LOG
85
- #{index}). #{name}:
86
- multiple configuration: #{hash[:multiple_configuration]}
87
- checksum: #{hash[:checksum]}
88
- checksum in lockfile#{"(git commitid)" if is_git_commitid}: #{checksum}
89
- LOG
90
- Pod::UI.puts log.red
91
- end
92
- end
93
- Pod::UI.puts "checksum校验失败的组件: #{failed}".red if failed.size > 0
94
- end
95
- end
96
- end
97
- end
98
- end