cocoapods-mtxx-bin 0.0.13 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cocoapods-mtxx-bin/command/bin/buildAll.rb +45 -23
  3. data/lib/cocoapods-mtxx-bin/command/bin/init.rb +14 -36
  4. data/lib/cocoapods-mtxx-bin/command/bin/lock/dependency.rb +82 -0
  5. data/lib/cocoapods-mtxx-bin/command/bin/lock/spec_repo.rb +105 -0
  6. data/lib/cocoapods-mtxx-bin/command/bin/lock/version.rb +41 -0
  7. data/lib/cocoapods-mtxx-bin/command/bin/lock.rb +36 -0
  8. data/lib/cocoapods-mtxx-bin/command/bin/outputSource.rb +18 -11
  9. data/lib/cocoapods-mtxx-bin/command/bin/upload.rb +2 -2
  10. data/lib/cocoapods-mtxx-bin/command/bin.rb +11 -12
  11. data/lib/cocoapods-mtxx-bin/config/config.rb +24 -49
  12. data/lib/cocoapods-mtxx-bin/config/config_asker.rb +1 -4
  13. data/lib/cocoapods-mtxx-bin/gem_version.rb +1 -1
  14. data/lib/cocoapods-mtxx-bin/helpers/buildAll/bin_helper.rb +11 -0
  15. data/lib/cocoapods-mtxx-bin/helpers/buildAll/builder.rb +44 -39
  16. data/lib/cocoapods-mtxx-bin/helpers/buildAll/podspec_util.rb +11 -8
  17. data/lib/cocoapods-mtxx-bin/helpers/buildAll/zip_file_helper.rb +17 -13
  18. data/lib/cocoapods-mtxx-bin/helpers/pod_size_helper.rb +30 -12
  19. data/lib/cocoapods-mtxx-bin/native/installer.rb +8 -7
  20. data/lib/cocoapods-mtxx-bin/native/podfile.rb +8 -0
  21. data/lib/cocoapods-mtxx-bin/native/podfile_env.rb +1 -0
  22. data/lib/cocoapods-mtxx-bin/native/resolver.rb +31 -32
  23. data/lib/cocoapods-mtxx-bin/native/sources_manager.rb +2 -1
  24. data/lib/cocoapods-mtxx-bin/source_provider_hook.rb +4 -2
  25. metadata +6 -6
  26. data/lib/cocoapods-mtxx-bin/command/bin/imy.rb +0 -45
  27. data/lib/cocoapods-mtxx-bin/command/bin/initHotKey.rb +0 -70
  28. data/lib/cocoapods-mtxx-bin/config/config_hot_key.rb +0 -103
  29. data/lib/cocoapods-mtxx-bin/config/config_hot_key_asker.rb +0 -57
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f14e9ea300e62342de7ad1999cba481413d19066015bba58eaffb5a75c95001c
4
- data.tar.gz: 5adc6de925603cc92ef507d48e77033d6d828d3e9503adfa9ea13a942771608e
3
+ metadata.gz: 41f8002bb6e1aebd88af984e688177d9ac4821eb2c1d006da248c2f269712b70
4
+ data.tar.gz: aeaf21d40990fe819241aed0115990d258b624331767f30e0a8bb9d437896b3e
5
5
  SHA512:
6
- metadata.gz: d302ef5efe2bdfba39904c903a68f779c7ae409276d4271a78f6663725af5d6f546322ca0a3693c595ca3cbea5adf0cb91067a7cf06b5eaa8fefca51b1bdb319
7
- data.tar.gz: f239253f6770287351b31fb9da0486272948a07036e59b50ec09651a8ed13f5c9da6893d3cce2f3b2b6c9ab41bf8e70fe46f243f028940e4d2d385e7816b81c8
6
+ metadata.gz: 947e653552621d2fd5d2798f672ab145d30b79f9f007fa0aea0c97137d8cc9018e1f03708b0c4685e844f298d8a48615fe521b8bf05dd2a4b9a490426b0ee230
7
+ data.tar.gz: 1c971b939a41dfe772bf233d9118ef83bf46672cd5421ba59a3211f4012c103cb17b7141888444b031397ff4a35f65ed7f9c4ae1e68501509054571a7cdb4d0c
@@ -24,22 +24,31 @@ module Pod
24
24
 
25
25
  def self.options
26
26
  [
27
- %w[--clean 删除编译临时目录],
27
+ %w[--clean 全部二进制包制作完成后删除编译临时目录],
28
+ %w[--clean-single 每制作完一个二进制包就删除该编译临时目录],
28
29
  %w[--repo-update 更新Podfile中指定的repo仓库],
29
- %w[--full-build 是否全量打包]
30
+ %w[--full-build 是否全量打包],
31
+ %w[--skip-simulator 跳过模拟器编译],
32
+ %w[--configuration=configName 在构建每个目标时使用configName指定构建配置,如:'Debug'、'Release'等]
30
33
  ].concat(super).uniq
31
34
  end
32
35
 
33
36
  def initialize(argv)
34
37
  @clean = argv.flag?('clean', false)
38
+ @clean_single = argv.flag?('clean-single', false)
35
39
  @repo_update = argv.flag?('repo-update', false)
36
40
  @full_build = argv.flag?('full-build', false)
41
+ @skip_simulator = argv.flag?('skip-simulator', false)
42
+ @configuration = argv.option('configuration', 'Debug')
37
43
  @base_dir = "#{Pathname.pwd}/build_pods"
38
44
  @version_helper = BinHelper.new
39
45
  super
40
46
  end
41
47
 
42
48
  def run
49
+ CBin.config.config_file_exist?
50
+ # 打印提示
51
+ print_tip
43
52
  # 开始时间
44
53
  @start_time = Time.now.to_i
45
54
  # 读取配置文件
@@ -64,6 +73,14 @@ module Pod
64
73
 
65
74
  private
66
75
 
76
+ def print_tip
77
+ UI.info '——————————————————————————————————'.blue
78
+ UI.info "|#{' '.center(32)}|".blue
79
+ UI.info "|#{"Configuration:`#{@configuration}`".center(32)}|".blue
80
+ UI.info "|#{' '.center(32)}|".blue
81
+ UI.info '——————————————————————————————————'.blue
82
+ end
83
+
67
84
  # 打印耗时
68
85
  def show_cost_time
69
86
  return if @start_time.nil?
@@ -73,7 +90,7 @@ module Pod
73
90
  # 读取配置文件
74
91
  def read_config
75
92
  UI.title 'Read config from file `BinConfig.yaml`'.green do
76
- config_file = File.join(CBin.config.binary_dir, 'BinConfig.yaml')
93
+ config_file = File.join(Pod::Config.instance.project_root, 'BinConfig.yaml')
77
94
  return unless File.exist?(config_file)
78
95
  config = YAML.safe_load(File.open(config_file))
79
96
  return if config.nil?
@@ -125,7 +142,7 @@ module Pod
125
142
  def podfile
126
143
  @podfile ||= begin
127
144
  podfile_path = File.join(Pathname.pwd, 'Podfile')
128
- raise 'Podfile不存在' unless File.exist?(podfile_path)
145
+ raise Informative, 'Podfile不存在' unless File.exist?(podfile_path)
129
146
  sources_manager = Pod::Config.instance.sources_manager
130
147
  podfile = Podfile.from_file(Pathname.new(podfile_path))
131
148
  podfile_hash = podfile.to_hash
@@ -140,7 +157,7 @@ module Pod
140
157
  def lockfile
141
158
  @lockfile ||= begin
142
159
  lock_path = File.join(Pathname.pwd, 'Podfile.lock')
143
- raise 'Podfile.lock不存在,请执行pod install' unless File.exist?(lock_path)
160
+ raise Informative, 'Podfile.lock不存在,请执行pod install' unless File.exist?(lock_path)
144
161
  Lockfile.from_file(Pathname.new(lock_path))
145
162
  end
146
163
  end
@@ -149,7 +166,7 @@ module Pod
149
166
  def sandbox
150
167
  @sandbox ||= begin
151
168
  sandbox_path = File.join(Pathname.pwd, 'Pods')
152
- raise 'Pods文件夹不存在,请执行pod install' unless File.exist?(sandbox_path)
169
+ raise Informative, 'Pods文件夹不存在,请执行pod install' unless File.exist?(sandbox_path)
153
170
  Pod::Sandbox.new(sandbox_path)
154
171
  end
155
172
  end
@@ -166,6 +183,14 @@ module Pod
166
183
  end
167
184
  end
168
185
 
186
+ # 删除单个Pod的编译中间产物
187
+ def clean_single_build_pod(pod_target)
188
+ UI.title "Clean build pod: `#{pod_target}`".green do
189
+ build_pod_path = File.join(Dir.pwd, 'build_pods', "#{pod_target}")
190
+ FileUtils.rm_rf(build_pod_path) if File.exist?(build_pod_path)
191
+ end
192
+ end
193
+
169
194
  # 删除编译产物
170
195
  def clean_build_pods
171
196
  UI.title 'Clean build pods'.green do
@@ -189,14 +214,10 @@ module Pod
189
214
  pod_targets.map do |pod_target|
190
215
  begin
191
216
  version = @version_helper.version(pod_target.pod_name, pod_target.root_spec.version.to_s, @analyze_result.specifications)
192
- # 全量
193
- if @full_build
194
- # 黑名单
195
- next if !@black_list.nil? && !@black_list.empty? && @black_list.include?(pod_target.pod_name)
196
- else
197
- # 白名单
198
- next if !@write_list.nil? && !@write_list.empty? && !@write_list.include?(pod_target.pod_name)
199
- end
217
+ # 黑名单(不分全量和非全量)
218
+ next if skip_build?(pod_target)
219
+ # 白名单(有白名单,只看白名单,不分全量和非全量)
220
+ next if !@write_list.nil? && !@write_list.empty? && !@write_list.include?(pod_target.pod_name)
200
221
  # 本地库
201
222
  if @sandbox.local?(pod_target.pod_name)
202
223
  local_pods << pod_target.pod_name
@@ -215,22 +236,20 @@ module Pod
215
236
  show_skip_tip("#{pod_target.pod_name} 无需编译")
216
237
  next
217
238
  end
218
- # 非全量编译、 不在白名单中且已经有相应的二进制版本
239
+ # 非全量编译、不在白名单中且已经有相应的二进制版本
219
240
  if has_created_binary?(pod_target.pod_name, version)
220
241
  created_pods << pod_target.pod_name
221
242
  show_skip_tip("#{pod_target.pod_name}(#{version}) 已经有二进制版本了")
222
243
  next
223
244
  end
224
- # 是否跳过编译(黑名单)
225
- next if skip_build?(pod_target)
226
245
  # 构建产物
227
- builder = Builder.new(pod_target, @sandbox.checkout_sources)
246
+ builder = Builder.new(pod_target, @sandbox.checkout_sources, @skip_simulator, @configuration)
228
247
  result = builder.build
229
248
  fail_pods << pod_target.pod_name unless result
230
249
  next unless result
231
250
  builder.create_binary
232
251
  # 压缩并上传zip
233
- zip_helper = ZipFileHelper.new(pod_target, version, builder.product_dir, builder.build_as_framework)
252
+ zip_helper = ZipFileHelper.new(pod_target, version, builder.product_dir, builder.build_as_framework?, @configuration)
234
253
  result = zip_helper.zip_lib
235
254
  fail_pods << pod_target.pod_name unless result
236
255
  next unless result
@@ -238,15 +257,18 @@ module Pod
238
257
  fail_pods << pod_target.pod_name unless result
239
258
  next unless result
240
259
  # 生成二进制podspec并上传
241
- podspec_creator = PodspecUtil.new(pod_target, version, builder.build_as_framework)
260
+ podspec_creator = PodspecUtil.new(pod_target, version, builder.build_as_framework?, @configuration)
242
261
  bin_spec = podspec_creator.create_binary_podspec
243
262
  bin_spec_file = podspec_creator.write_binary_podspec(bin_spec)
244
- podspec_creator.push_binary_podspec(bin_spec_file)
245
- success_pods << pod_target.pod_name
263
+ result = podspec_creator.push_binary_podspec(bin_spec_file)
264
+ fail_pods << pod_target.pod_name unless result
265
+ success_pods << pod_target.pod_name if result
246
266
  rescue Pod::StandardError => e
247
- UI.info "#{pod_target} 编译失败,原因:#{e}".red
267
+ UI.info "`#{pod_target}`编译失败,原因:#{e}".red
248
268
  fail_pods << pod_target.pod_name
249
269
  next
270
+ ensure
271
+ clean_single_build_pod(pod_target) if @clean_single
250
272
  end
251
273
  end
252
274
  results = {
@@ -4,56 +4,53 @@ module Pod
4
4
  class Command
5
5
  class Bin < Command
6
6
  class Init < Bin
7
- self.summary = '初始化插件'
7
+ self.summary = '配置插件'
8
8
  self.description = <<-DESC
9
- 创建yml配置文件,保存插件需要的配置信息,如源码podspec仓库、二进制下载地址等
9
+ 创建yml配置文件,保存插件需要的配置信息,如二进制podspec仓库、二进制下载地址等
10
10
  DESC
11
11
 
12
12
  def self.options
13
13
  [
14
- %w[--bin-url=URL 配置文件地址,直接从此地址下载配置文件],
15
- ['--update-sources', '更新源码私有源配置 bin_dev.yml 中的 code_repo_url_list 配置,支持多私有源,多个私有源用分号区分 example:git@techgit.meitu.com:iMeituPic/mtsourcespecs.git;git@techgit.meitu.com:iosmodules/specs.git;https://github.com/CocoaPods/Specs.git']
14
+ %w[--bin-url=URL 配置文件地址,直接从此地址下载配置文件]
16
15
  ].concat(super)
17
16
  end
18
17
 
19
18
  def initialize(argv)
20
19
  @bin_url = argv.option('bin-url')
21
- @update_sources = argv.flag?('update-sources')
22
20
  super
23
21
  end
24
22
 
25
23
  def run
26
- if @update_sources
27
- update_code_repo_url_list
24
+ raise Informative, "当前目录下没有`Podfile`文件" unless File.exist?(File.join(Dir.pwd, "Podfile"))
25
+ raise Informative, "当前目录下已经存在配置文件" if File.exist?(CBin.config.config_file)
26
+ if @bin_url.nil?
27
+ config_with_asker
28
28
  else
29
- if @bin_url.nil?
30
- config_with_asker
31
- else
32
- config_with_url(@bin_url)
33
- end
29
+ config_with_url(@bin_url)
34
30
  end
35
-
36
31
  end
37
32
 
38
33
  private
39
34
 
35
+ # 从远端下载配置文件
40
36
  def config_with_url(url)
41
37
  require 'open-uri'
42
38
 
43
- UI.puts "开始下载配置文件...\n"
39
+ UI.puts "开始下载配置文件..."
44
40
  file = open(url)
45
41
  contents = YAML.safe_load(file.read)
46
42
 
47
- UI.puts "开始同步配置文件...\n"
43
+ UI.puts "开始同步配置文件..."
48
44
  CBin.config.sync_config(contents.to_hash)
49
- UI.puts "设置完成.\n".green
45
+ UI.puts "设置完成.".green
50
46
  rescue Errno::ENOENT => e
51
47
  raise Informative, "配置文件路径 #{url} 无效,请确认后重试."
52
48
  end
53
49
 
50
+ # 询问用户相关的配置
54
51
  def config_with_asker
55
52
  asker = CBin::Config::Asker.new
56
- asker.wellcome_message
53
+ asker.welcome_message
57
54
 
58
55
  config = {}
59
56
  template_hash = CBin.config.template_hash
@@ -69,25 +66,6 @@ module Pod
69
66
  CBin.config.sync_config(config)
70
67
  asker.done_message
71
68
  end
72
- def update_code_repo_url_list
73
- asker = CBin::Config::Asker.new
74
- config = {}
75
- template_hash = CBin.config.template_hash
76
- template_hash.each do |k, v|
77
- if k == "code_repo_url_list"
78
- default = begin
79
- CBin.config.send(k)
80
- rescue StandardError
81
- nil
82
- end
83
- config[k] = asker.ask_with_answer(v[:description], default, v[:selection])
84
- else
85
- config[k] = CBin.config.config_old[k]
86
- end
87
- end
88
- CBin.config.sync_config_code_repo_url_list(config)
89
- asker.done_message_update
90
- end
91
69
  end
92
70
  end
93
71
  end
@@ -0,0 +1,82 @@
1
+
2
+ module Pod
3
+ class Command
4
+ class Bin < Command
5
+ class Lock < Bin
6
+ class Dependency < Lock
7
+ include Pod
8
+
9
+ self.summary = '分析`POD_NAME`依赖的库'
10
+ self.description = <<-DESC
11
+ #{self.summary},如果加上`--reverse`,则分析依赖`POD_NAME`的库
12
+ DESC
13
+
14
+ self.arguments = [
15
+ CLAide::Argument.new('POD_NAME', true)
16
+ ]
17
+
18
+ def self.options
19
+ [
20
+ %w[--reverse 分析依赖`POD_NAME`的库]
21
+ ].concat(super).uniq
22
+ end
23
+
24
+ def initialize(argv)
25
+ super
26
+ @pod_name = argv.shift_argument
27
+ @reverse = argv.flag?('reverse', false)
28
+ end
29
+
30
+ def run
31
+ super
32
+ raise Informative, "请输入Pod库名称,如:AFNetworking" if @pod_name.nil?
33
+ if @reverse
34
+ reverse_dependencies
35
+ else
36
+ dependencies
37
+ end
38
+ end
39
+
40
+ def dependencies
41
+ deps = []
42
+ @analyze_result.specifications.map do |spec|
43
+ if spec.name == @pod_name
44
+ deps.concat(spec.all_dependencies)
45
+ end
46
+ end
47
+ deps.uniq!
48
+ UI.puts "\n"
49
+ if deps.empty?
50
+ UI.puts "`#{@pod_name}`无依赖的库".red
51
+ else
52
+ UI.puts "`#{@pod_name}`依赖的库如下:".yellow
53
+ deps.map { |dep| UI.puts "- #{dep}" }
54
+ UI.puts "total #{deps.size} deps".green
55
+ end
56
+ end
57
+
58
+ def reverse_dependencies
59
+ pods = []
60
+ @analyze_result.specifications.map do |spec|
61
+ spec.all_dependencies.map do |dep|
62
+ if dep.name == @pod_name
63
+ pods << spec
64
+ break
65
+ end
66
+ end
67
+ end
68
+ pods.uniq!
69
+ UI.puts "\n"
70
+ if pods.empty?
71
+ UI.puts "没有依赖`#{@pod_name}`的库".red
72
+ else
73
+ UI.puts "依赖`#{@pod_name}`的库如下:".yellow
74
+ pods.map { |dep| UI.puts "- #{dep}" }
75
+ UI.puts "total #{pods.size} pods".green
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,105 @@
1
+
2
+ module Pod
3
+ class Command
4
+ class Bin < Command
5
+ class Lock < Bin
6
+ class SpecRepo < Lock
7
+ include Pod
8
+
9
+ self.summary = '分析`podspec`源'
10
+ self.description = <<-DESC
11
+ #{self.summary},如果加`POD_NAME`,则分析该`POD_NAME`所属的repo仓库;如果不加,则打印项目中用到的repo仓库及每个仓库下Pod个数
12
+ DESC
13
+
14
+ self.arguments = [
15
+ CLAide::Argument.new('POD_NAME', false)
16
+ ]
17
+
18
+ def initialize(argv)
19
+ super
20
+ @pod_name = argv.shift_argument
21
+ end
22
+
23
+ def run
24
+ super
25
+ if @pod_name.nil?
26
+ spec_repo_summary
27
+ else
28
+ pod_source
29
+ end
30
+ end
31
+
32
+ private
33
+
34
+ def spec_repos
35
+ raise Informative, "依赖分析失败" if @analyze_result.nil?
36
+ result = Hash.new
37
+ @analyze_result.specs_by_source.map do |source, specs|
38
+ next unless source
39
+ next if specs.empty?
40
+ key = source.url || source.name
41
+
42
+ # save `trunk` as 'trunk' so that the URL itself can be changed without lockfile churn
43
+ key = Pod::TrunkSource::TRUNK_REPO_NAME if source.name == Pod::TrunkSource::TRUNK_REPO_NAME
44
+
45
+ value = specs.map { |s| s.root.name }.uniq
46
+ # 合并重复的source源,而不是替换
47
+ if result[key].nil?
48
+ result[key] = YAMLHelper.sorted_array(value)
49
+ else
50
+ result[key] = YAMLHelper.sorted_array(result[key].concat(value))
51
+ end
52
+ end
53
+ result.compact
54
+ end
55
+
56
+ def external_sources
57
+ deps = config.podfile.dependencies.select(&:external?)
58
+ deps = deps.sort { |d, other| d.name <=> other.name }
59
+ sources = {}
60
+ deps.each { |d| sources[d.root_name] = d.external_source }
61
+ sources
62
+ end
63
+
64
+ # 打印所有source及其pods个数
65
+ def spec_repo_summary
66
+ pod_count = 0
67
+ UI.puts "\n"
68
+ spec_repos.map do |source, specs|
69
+ pod_count += specs.size
70
+ UI.puts "#{source}".yellow
71
+ UI.puts "- #{specs.size} pods"
72
+ end
73
+ pod_count += external_sources.keys.size
74
+ UI.puts "External".yellow
75
+ UI.puts "- #{external_sources.keys.size} pods"
76
+
77
+ UI.puts "\n"
78
+ UI.puts "total #{spec_repos.size + 1} sources, #{pod_count} pods".green
79
+ end
80
+
81
+ # 打印pod所属的source
82
+ def pod_source
83
+ sources = []
84
+ external = false
85
+ spec_repos.map do |source, specs|
86
+ if specs.include?(@pod_name)
87
+ sources << source
88
+ end
89
+ end
90
+ external_sources.map do |pod, ext_source|
91
+ if pod == @pod_name
92
+ external = true
93
+ sources << ext_source
94
+ end
95
+ end
96
+ UI.puts "\n"
97
+ raise Informative, "未找到`#{@pod_name}`所属的source,请检查`#{@pod_name}`是否拼写错误" if sources.empty?
98
+ UI.puts "#{@pod_name}#{external ? ' (External Source)' : ''}".yellow
99
+ sources.map { |source| UI.puts "- #{source}" }
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,41 @@
1
+
2
+ module Pod
3
+ class Command
4
+ class Bin < Command
5
+ class Lock < Bin
6
+ class Version < Lock
7
+ include Pod
8
+
9
+ self.summary = '分析项目中使用的`Pod`库版本'
10
+
11
+ self.arguments = [
12
+ CLAide::Argument.new('POD_NAME', true)
13
+ ]
14
+
15
+ def initialize(argv)
16
+ super
17
+ @pod_name = argv.shift_argument
18
+ end
19
+
20
+ def run
21
+ super
22
+ raise Informative, "请输入Pod库名称,如:AFNetworking" if @pod_name.nil?
23
+ versions = []
24
+ @analyze_result.specifications.map do |spec|
25
+ if spec.name == @pod_name
26
+ versions << spec.version
27
+ end
28
+ end
29
+ versions = versions.uniq
30
+ UI.puts "\n"
31
+ raise Informative, "未查找到`#{@pod_name}`的版本号,请检查`#{@pod_name}`是否拼写错误" if versions.empty?
32
+ UI.puts "`#{@pod_name}`版本如下:".yellow
33
+ versions.map { |v| UI.puts "- #{v}" }
34
+
35
+ UI.puts "[!] `#{@pod_name}`有`#{versions.size}`个版本,可能会导致意想不到的事情,请确保每个Pod库只有一个依赖版本".yellow if versions.size > 1
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,36 @@
1
+ require 'cocoapods-mtxx-bin/command/bin/lock/spec_repo'
2
+ require 'cocoapods-mtxx-bin/command/bin/lock/version'
3
+ require 'cocoapods-mtxx-bin/command/bin/lock/dependency'
4
+
5
+ module Pod
6
+ class Command
7
+ class Bin < Command
8
+ class Lock < Bin
9
+ include Pod
10
+ include Config::Mixin
11
+
12
+ self.abstract_command = true
13
+ self.summary = '分析 Pod 依赖关系'
14
+
15
+ def initialize(argv)
16
+ super
17
+ end
18
+
19
+ def run
20
+ # 校验Podfile是否存在
21
+ verify_podfile_exists!
22
+ # 依赖分析
23
+ @analyze_result = analyze
24
+ end
25
+
26
+ # 依赖分析
27
+ def analyze
28
+ UI.title 'Analyze dependencies'.green do
29
+ analyzer = Pod::Installer::Analyzer.new(config.sandbox, config.podfile, config.lockfile)
30
+ analyzer.analyze(true )
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -46,25 +46,32 @@ module Pod
46
46
  all_source_list = []
47
47
  error_source_list = []
48
48
  @analyze_result.specifications.each do |specification|
49
- next if specification.subspec?
50
- all_source_list << specification.source
51
- if @error_source && verified_git_address(specification)
52
- error_source_list << specification.name + ' ' + specification.source[:git] + + ' ' + specification.source[:tag]
49
+ all_source_list << {specification.root.name => specification.root.source}
50
+ if @error_source && invalid_git_address?(specification)
51
+ error_source_list << {specification.root.name => specification.root.source}
53
52
  end
54
53
  end
55
54
  if @error_source
56
- UI.info '问题组件,source 为http CI打包不支持http认证,应修改为ssh'.red
57
- UI.info error_source_list.to_s.red
55
+ if error_source_list.uniq.empty?
56
+ UI.info "没有有问题的组件".green
57
+ else
58
+ UI.info '问题组件,source 为http CI打包不支持http认证,应修改为ssh'.red
59
+ error_source_list.uniq.map do |source|
60
+ UI.info "- #{source}".red
61
+ end
62
+ end
58
63
  else
59
- UI.info '输出所有pod组件source'.green
60
- UI.info error_source_list.to_s.green
64
+ UI.info '输出所有pod组件source'.yellow
65
+ all_source_list.uniq.map do |source|
66
+ UI.info "- #{source}"
67
+ end
61
68
  end
62
69
  end
63
70
 
64
71
  # git clone 地址 是否非法
65
- def verified_git_address(specification)
66
- return false if specification.source[:git].nil?
67
- git = specification.source[:git]
72
+ def invalid_git_address?(specification)
73
+ return false if specification.root.source[:git].nil?
74
+ git = specification.root.source[:git]
68
75
  git.include?('http://techgit.meitu.com') || git.include?('https://techgit.meitu.com')
69
76
  end
70
77
 
@@ -39,7 +39,7 @@ pod bin upload Pod1 1.0.0 Pod1.framework mtxxspecs --spec=Pod1.podspec
39
39
  @file = argv.shift_argument
40
40
  @repo = argv.shift_argument
41
41
  @spec = argv.option('spec', nil)
42
- @xcode_version = BinHelper.xcode_version
42
+ @xcode_version = CBin::BuildAll::BinHelper.xcode_version
43
43
  super
44
44
  end
45
45
 
@@ -128,7 +128,7 @@ pod bin upload Pod1 1.0.0 Pod1.framework mtxxspecs --spec=Pod1.podspec
128
128
 
129
129
  def source
130
130
  url = "#{CBin.config.binary_download_url_str}/#{@xcode_version}/#{@name}/#{@version}/#{zip_file_name}"
131
- { http: url, type: 'zip' }
131
+ { http: url, type: CBin.config.download_file_type }
132
132
  end
133
133
 
134
134
  # 上传podspec
@@ -1,18 +1,17 @@
1
- # require 'cocoapods-mtxx-bin/command/bin/initHotKey'
2
1
  require 'cocoapods-mtxx-bin/command/bin/init'
3
- require 'cocoapods-mtxx-bin/command/bin/archive'
4
- require 'cocoapods-mtxx-bin/command/bin/auto'
2
+ # require 'cocoapods-mtxx-bin/command/bin/archive'
3
+ # require 'cocoapods-mtxx-bin/command/bin/auto'
5
4
  # require 'cocoapods-mtxx-bin/command/bin/code'
6
- require 'cocoapods-mtxx-bin/command/bin/update'
7
- require 'cocoapods-mtxx-bin/command/bin/install'
8
- # require 'cocoapods-mtxx-bin/command/bin/imy'
5
+ # require 'cocoapods-mtxx-bin/command/bin/update'
6
+ # require 'cocoapods-mtxx-bin/command/bin/install'
9
7
  require 'cocoapods-mtxx-bin/command/bin/repo'
10
8
  require 'cocoapods-mtxx-bin/command/bin/spec'
11
9
  require 'cocoapods-mtxx-bin/command/bin/buildAll'
12
10
  require 'cocoapods-mtxx-bin/command/bin/outputSource'
13
11
  require 'cocoapods-mtxx-bin/command/bin/upload'
12
+ require 'cocoapods-mtxx-bin/command/bin/lock'
14
13
  require 'cocoapods-mtxx-bin/helpers'
15
- # require 'cocoapods-mtxx-bin/native'
14
+ require 'cocoapods-mtxx-bin/helpers/framework_builder'
16
15
 
17
16
  module Pod
18
17
  class Command
@@ -41,11 +40,11 @@ module Pod
41
40
 
42
41
  # self.default_subcommand = 'open'
43
42
  self.summary = '组件二进制化插件'
44
- self.description = <<-DESC.strip_heredoc
45
- 组件二进制化插件
46
-
47
- 利用源码私有源与二进制私有源实现对组件依赖类型的切换
48
- DESC
43
+ # self.description = <<-DESC.strip_heredoc
44
+ # 组件二进制化插件
45
+ #
46
+ # 利用源码私有源与二进制私有源实现对组件依赖类型的切换
47
+ # DESC
49
48
 
50
49
  def initialize(argv)
51
50
  # !!! 下面这个require必须放在这里,不能放到文件顶部,切记 !!!