cocoapods-mtxx-bin 0.0.7 → 0.0.9.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df7e5b2628a85abdfb8c632ce10affd45eceef978f17030cc8fa587a55937052
4
- data.tar.gz: 8ce6a4a89a75c32075f406d9ec8c929eac12b9b3b63e114f61b37ab56112a576
3
+ metadata.gz: c65c28411ebe84f39594b4edc5a6c83729b48faf97715af4439f9df0b5c61553
4
+ data.tar.gz: 3fd4c776db20bdfa9c3284a50b4d4d55f50f7cb1a5ce024719a998e616b8b802
5
5
  SHA512:
6
- metadata.gz: 6bb9deccb62a75ca54db13fb02f2b1c43b0a0cd5f945fd18bcfd34858b1a16c35df4d4214f5942dd1480fe9bfae9035687989db60c53e1d000ebc51654749491
7
- data.tar.gz: dff8ecc36300ffd1e885d1f968f43276a9c055b24fb8dc791b4d568ac985928e468ae2e46d198d1589bfabf17fc0f390557ee083b3377de10e5a34b08d263de2
6
+ metadata.gz: cd94102dd7f8d97eb32155f7090d6cdde300ee7f159872658e35ad2338380f43f28d8f7be04725f11d185166e0f05b5130e4694b5ad53375cb3bfc16b954493d
7
+ data.tar.gz: 676ebc6e13e65715e86464b783f7c157506915985664a609ba697cb0db1853ec806a347327c4e66b3c624c2b8a6d7204c12b7757b5a7527a9bec731277abac11
@@ -19,7 +19,7 @@ module Pod
19
19
 
20
20
  self.summary = '根据壳工程打包所有依赖组件为静态库(static framework)'
21
21
  self.description = <<-DESC
22
- #{self.summary}
22
+ #{summary}
23
23
  DESC
24
24
 
25
25
  def self.options
@@ -31,9 +31,9 @@ module Pod
31
31
  end
32
32
 
33
33
  def initialize(argv)
34
- @clean = argv.flag?('clean', false )
35
- @repo_update = argv.flag?('repo-update', false )
36
- @full_build = argv.flag?('full-build', false )
34
+ @clean = argv.flag?('clean', false)
35
+ @repo_update = argv.flag?('repo-update', false)
36
+ @full_build = argv.flag?('full-build', false)
37
37
  @base_dir = "#{Pathname.pwd}/build_pods"
38
38
  super
39
39
  end
@@ -71,10 +71,10 @@ module Pod
71
71
 
72
72
  # 读取配置文件
73
73
  def read_config
74
- UI.title "Read config from file `BinConfig.yaml`".green do
74
+ UI.title 'Read config from file `BinConfig.yaml`'.green do
75
75
  config_file = File.join(CBin.config.binary_dir, 'BinConfig.yaml')
76
76
  return unless File.exist?(config_file)
77
- config = YAML.load(File.open(config_file))
77
+ config = YAML.safe_load(File.open(config_file))
78
78
  return if config.nil?
79
79
  build_config = config['build_config']
80
80
  return if build_config.nil?
@@ -87,38 +87,44 @@ module Pod
87
87
 
88
88
  # 更新repo仓库
89
89
  def repo_update
90
- UI.title "Repo update".green do
91
- return if podfile.nil?
92
- sources_manager = Pod::Config.instance.sources_manager
93
- podfile.sources.uniq.map { |src|
94
- # next if src.include?(CDN) || src.include?(MASTER_HTTP) || src.include?(MASTER_SSH)
95
- next unless src.include?(MT_REPO)
96
- UI.message "Update repo: #{src}"
97
- source = sources_manager.source_with_name_or_url(src)
98
- source.update(false )
99
- }
100
- end if @repo_update
90
+ if @repo_update
91
+ UI.title 'Repo update'.green do
92
+ return if podfile.nil?
93
+ sources_manager = Pod::Config.instance.sources_manager
94
+ podfile.sources.uniq.map do |src|
95
+ # next if src.include?(CDN) || src.include?(MASTER_HTTP) || src.include?(MASTER_SSH)
96
+ next unless src.include?(MT_REPO)
97
+ UI.message "Update repo: #{src}"
98
+ source = sources_manager.source_with_name_or_url(src)
99
+ source.update(false)
100
+ end
101
+ end
102
+ end
101
103
  end
102
104
 
103
105
  # 执行pre build
104
106
  def pre_build
105
- UI.title "Execute the command of pre build".green do
106
- system(@pre_build)
107
- end if @pre_build
107
+ if @pre_build
108
+ UI.title 'Execute the command of pre build'.green do
109
+ system(@pre_build)
110
+ end
111
+ end
108
112
  end
109
113
 
110
114
  # 执行post build
111
- def post_build(results)
112
- UI.title "Execute the command of post build".green do
113
- system(@post_build)
114
- end if @post_build
115
+ def post_build(_results)
116
+ if @post_build
117
+ UI.title 'Execute the command of post build'.green do
118
+ system(@post_build)
119
+ end
120
+ end
115
121
  end
116
122
 
117
123
  # 获取 podfile
118
124
  def podfile
119
125
  @podfile ||= begin
120
- podfile_path = File.join(Pathname.pwd,"Podfile")
121
- raise "Podfile不存在" unless File.exist?(podfile_path)
126
+ podfile_path = File.join(Pathname.pwd, 'Podfile')
127
+ raise 'Podfile不存在' unless File.exist?(podfile_path)
122
128
  sources_manager = Pod::Config.instance.sources_manager
123
129
  podfile = Podfile.from_file(Pathname.new(podfile_path))
124
130
  podfile_hash = podfile.to_hash
@@ -132,8 +138,8 @@ module Pod
132
138
  # 获取 podfile.lock
133
139
  def lockfile
134
140
  @lockfile ||= begin
135
- lock_path = File.join(Pathname.pwd,"Podfile.lock")
136
- raise "Podfile.lock不存在,请执行pod install" unless File.exist?(lock_path)
141
+ lock_path = File.join(Pathname.pwd, 'Podfile.lock')
142
+ raise 'Podfile.lock不存在,请执行pod install' unless File.exist?(lock_path)
137
143
  Lockfile.from_file(Pathname.new(lock_path))
138
144
  end
139
145
  end
@@ -141,30 +147,30 @@ module Pod
141
147
  # 获取 sandbox
142
148
  def sandbox
143
149
  @sandbox ||= begin
144
- sandbox_path = File.join(Pathname.pwd, "Pods")
145
- raise "Pods文件夹不存在,请执行pod install" unless File.exist?(sandbox_path)
150
+ sandbox_path = File.join(Pathname.pwd, 'Pods')
151
+ raise 'Pods文件夹不存在,请执行pod install' unless File.exist?(sandbox_path)
146
152
  Pod::Sandbox.new(sandbox_path)
147
153
  end
148
154
  end
149
155
 
150
156
  # 根据podfile和podfile.lock分析依赖
151
157
  def analyse
152
- UI.title "Analyze dependencies".green do
158
+ UI.title 'Analyze dependencies'.green do
153
159
  analyzer = Pod::Installer::Analyzer.new(
154
160
  sandbox,
155
161
  podfile,
156
162
  lockfile
157
163
  )
158
- analyzer.analyze(true )
164
+ analyzer.analyze(true)
159
165
  end
160
166
  end
161
167
 
162
168
  # 删除编译产物
163
169
  def clean_build_pods
164
- UI.title "Clean build pods".green do
165
- build_path = Dir.pwd + "/build"
170
+ UI.title 'Clean build pods'.green do
171
+ build_path = Dir.pwd + '/build'
166
172
  FileUtils.rm_rf(build_path) if File.exist?(build_path)
167
- build_pods_path = Dir.pwd + "/build_pods"
173
+ build_pods_path = Dir.pwd + '/build_pods'
168
174
  FileUtils.rm_rf(build_pods_path) if File.exist?(build_pods_path)
169
175
  end
170
176
  end
@@ -269,14 +275,14 @@ module Pod
269
275
 
270
276
  # 展示结果
271
277
  def show_results(results)
272
- UI.title "打包结果:".green do
273
- UI.info "——————————————————————————————————".green
274
- UI.info "|#{"Type".center(20)}|#{"Count".center(11)}|".green
275
- UI.info "——————————————————————————————————".green
278
+ UI.title '打包结果:'.green do
279
+ UI.info '——————————————————————————————————'.green
280
+ UI.info "|#{'Type'.center(20)}|#{'Count'.center(11)}|".green
281
+ UI.info '——————————————————————————————————'.green
276
282
  results.each do |key, value|
277
283
  UI.info "|#{key.center(20)}|#{value.size.to_s.center(11)}|".green
278
284
  end
279
- UI.info "——————————————————————————————————".green
285
+ UI.info '——————————————————————————————————'.green
280
286
 
281
287
  # 打印出失败的 target
282
288
  unless results['Fail'].empty?
@@ -304,7 +310,6 @@ module Pod
304
310
  end
305
311
  result
306
312
  end
307
-
308
313
  end
309
314
  end
310
315
  end
@@ -0,0 +1,141 @@
1
+ require 'cocoapods-mtxx-bin/helpers/buildAll/builder'
2
+ require 'cocoapods-mtxx-bin/helpers/buildAll/podspec_util'
3
+ require 'cocoapods-mtxx-bin/helpers/buildAll/zip_file_helper'
4
+ require 'cocoapods-mtxx-bin/helpers/buildAll/bin_helper'
5
+ require 'cocoapods-mtxx-bin/config/config'
6
+ require 'yaml'
7
+ require 'digest'
8
+
9
+ module Pod
10
+ class Command
11
+ class Bin < Command
12
+ class OutputSource < Bin
13
+ self.summary = '输出各个组件的source源,默认输出全部组件的source'
14
+ self.description = <<-DESC
15
+ #{summary}
16
+ DESC
17
+
18
+ def self.options
19
+ [
20
+ %w[--error-source 过滤异常的source,比如http的,CI打包只支持SSH认证]
21
+ ].concat(super).uniq
22
+ end
23
+
24
+ def initialize(argv)
25
+ @error_source = argv.flag?('error-source', false)
26
+ super
27
+ end
28
+
29
+ def run
30
+ # 开始时间
31
+ @start_time = Time.now.to_i
32
+ # 更新repo仓库
33
+ repo_update
34
+ # 分析依赖
35
+ @analyze_result = analyse
36
+ # 打印source
37
+ show_cost_source
38
+ # 计算耗时
39
+ show_cost_time
40
+ end
41
+
42
+ private
43
+
44
+ # 打印source
45
+ def show_cost_source
46
+ all_source_list = []
47
+ error_source_list = []
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]
53
+ end
54
+ end
55
+ if @error_source
56
+ UI.info '问题组件,source 为http CI打包不支持http认证,应修改为ssh'.red
57
+ UI.info error_source_list.to_s.red
58
+ else
59
+ UI.info '输出所有pod组件source'.green
60
+ UI.info error_source_list.to_s.green
61
+ end
62
+ end
63
+
64
+ # git clone 地址 是否非法
65
+ def verified_git_address(specification)
66
+ return false if specification.source[:git].nil?
67
+ git = specification.source[:git]
68
+ git.include?('http://techgit.meitu.com') || git.include?('https://techgit.meitu.com')
69
+ end
70
+
71
+ # 打印耗时
72
+ def show_cost_time
73
+ return if @start_time.nil?
74
+ UI.info "总耗时:#{Time.now.to_i - @start_time}s".green
75
+ end
76
+
77
+ # 更新repo仓库
78
+ def repo_update
79
+ if @repo_update
80
+ UI.title 'Repo update'.green do
81
+ return if podfile.nil?
82
+ sources_manager = Pod::Config.instance.sources_manager
83
+ podfile.sources.uniq.map do |src|
84
+ # next if src.include?(CDN) || src.include?(MASTER_HTTP) || src.include?(MASTER_SSH)
85
+ next unless src.include?(MT_REPO)
86
+ UI.message "Update repo: #{src}"
87
+ source = sources_manager.source_with_name_or_url(src)
88
+ source.update(false)
89
+ end
90
+ end
91
+ end
92
+ end
93
+
94
+ # 获取 podfile
95
+ def podfile
96
+ @podfile ||= begin
97
+ podfile_path = File.join(Pathname.pwd, 'Podfile')
98
+ raise 'Podfile不存在' unless File.exist?(podfile_path)
99
+ sources_manager = Pod::Config.instance.sources_manager
100
+ podfile = Podfile.from_file(Pathname.new(podfile_path))
101
+ podfile_hash = podfile.to_hash
102
+ podfile_hash['sources'] = (podfile_hash['sources'] || []).concat(sources_manager.code_source_list.map(&:url))
103
+ podfile_hash['sources'] << sources_manager.binary_source.url
104
+ podfile_hash['sources'].uniq!
105
+ Podfile.from_hash(podfile_hash)
106
+ end
107
+ end
108
+
109
+ # 获取 podfile.lock
110
+ def lockfile
111
+ @lockfile ||= begin
112
+ lock_path = File.join(Pathname.pwd, 'Podfile.lock')
113
+ raise 'Podfile.lock不存在,请执行pod install' unless File.exist?(lock_path)
114
+ Lockfile.from_file(Pathname.new(lock_path))
115
+ end
116
+ end
117
+
118
+ # 获取 sandbox
119
+ def sandbox
120
+ @sandbox ||= begin
121
+ sandbox_path = File.join(Pathname.pwd, 'Pods')
122
+ raise 'Pods文件夹不存在,请执行pod install' unless File.exist?(sandbox_path)
123
+ Pod::Sandbox.new(sandbox_path)
124
+ end
125
+ end
126
+
127
+ # 根据podfile和podfile.lock分析依赖
128
+ def analyse
129
+ UI.title 'Analyze dependencies'.green do
130
+ analyzer = Pod::Installer::Analyzer.new(
131
+ sandbox,
132
+ podfile,
133
+ lockfile
134
+ )
135
+ analyzer.analyze(true)
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
@@ -9,6 +9,7 @@ require 'cocoapods-mtxx-bin/command/bin/install'
9
9
  require 'cocoapods-mtxx-bin/command/bin/repo'
10
10
  require 'cocoapods-mtxx-bin/command/bin/spec'
11
11
  require 'cocoapods-mtxx-bin/command/bin/buildAll'
12
+ require 'cocoapods-mtxx-bin/command/bin/outputSource'
12
13
  require 'cocoapods-mtxx-bin/command/bin/upload'
13
14
  require 'cocoapods-mtxx-bin/helpers'
14
15
  # require 'cocoapods-mtxx-bin/native'
@@ -42,7 +43,7 @@ module Pod
42
43
  self.summary = '组件二进制化插件'
43
44
  self.description = <<-DESC.strip_heredoc
44
45
  组件二进制化插件
45
-
46
+
46
47
  利用源码私有源与二进制私有源实现对组件依赖类型的切换
47
48
  DESC
48
49
 
@@ -1,5 +1,5 @@
1
1
  module CBin
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.9.1"
3
3
  end
4
4
 
5
5
  module Pod
@@ -10,6 +10,8 @@ module CBin
10
10
  specs = specifications.map(&:name).select { |spec|
11
11
  spec.include?(pod_name) && !spec.include?('/Binary')
12
12
  }.sort!
13
+ xcode_version = `xcodebuild -version`.split(' ').join('')
14
+ specs << xcode_version
13
15
  specs_str = specs.join('')
14
16
  "#{original_version}.bin#{Digest::MD5.hexdigest(specs_str)[0,6]}"
15
17
  end
@@ -94,12 +94,16 @@ module CBin
94
94
  "#{@base_dir}/#{@pod_target}/Temp"
95
95
  end
96
96
 
97
+ def configuration
98
+ "Debug"
99
+ end
100
+
97
101
  def iphoneos
98
- "Release-iphoneos"
102
+ "#{configuration}-iphoneos"
99
103
  end
100
104
 
101
105
  def iphonesimulator
102
- "Release-iphonesimulator"
106
+ "#{configuration}-iphonesimulator"
103
107
  end
104
108
 
105
109
  # 需要排除的资源文件后缀
@@ -130,12 +134,13 @@ CONFIGURATION_TEMP_DIR=#{temp_dir} \
130
134
  BUILD_ROOT=#{product_dir} \
131
135
  BUILD_DIR=#{product_dir} \
132
136
  clean build \
133
- -configuration Release \
137
+ -configuration #{configuration} \
134
138
  -target #{@pod_target} \
135
139
  -project #{project}
136
140
  BUILD
137
141
  UI.info "#{command}"
138
- `#{command}`
142
+ output = `#{command}`
143
+ puts output
139
144
  if $CHILD_STATUS.exitstatus != 0
140
145
  UI.info "#{@pod_target}(#{sdk}) 编译失败!".red
141
146
  return false
@@ -1,11 +1,30 @@
1
1
 
2
-
3
2
  require 'parallel'
4
3
  require 'cocoapods'
5
4
 
6
5
  module Pod
7
6
  class Installer
8
7
  class Analyzer
8
+ alias old_fetch_external_sources fetch_external_sources
9
+ def fetch_external_sources(podfile_state)
10
+ verify_no_pods_with_different_sources!
11
+ deps = dependencies_to_fetch(podfile_state)
12
+ pods = pods_to_fetch(podfile_state)
13
+ return if deps.empty?
14
+ UI.section 'Fetching external sources' do
15
+ if installation_options.install_with_multi_threads
16
+ thread_count = installation_options.multi_threads_count
17
+ Parallel.each(deps.sort, in_threads: thread_count) do |dependency|
18
+ fetch_external_source(dependency, !pods.include?(dependency.root_name))
19
+ end
20
+ else
21
+ deps.sort.each do |dependency|
22
+ fetch_external_source(dependency, !pods.include?(dependency.root_name))
23
+ end
24
+ end
25
+ end
26
+ end
27
+
9
28
  # > 1.6.0
10
29
  # all_specs[dep.name] 为 nil 会崩溃
11
30
  # 主要原因是 all_specs 分析错误
@@ -32,15 +51,16 @@ module Pod
32
51
  #
33
52
  alias old_update_repositories update_repositories
34
53
  def update_repositories
35
- if installation_options.update_source_with_multi_processes
54
+ if installation_options.update_source_with_multi_threads
36
55
  # 并发更新私有源
37
56
  # 这里多线程会导致 pod update 额外输出 --verbose 的内容
38
57
  # 不知道为什么?
39
- Parallel.each(sources.uniq(&:url), in_processes: 4) do |source|
40
- if source.git?
41
- config.sources_manager.update(source.name, true)
58
+ thread_count = installation_options.multi_threads_count
59
+ Parallel.each(sources.uniq(&:url), in_threads: thread_count) do |source|
60
+ if source.updateable?
61
+ sources_manager.update(source.name, true)
42
62
  else
43
- UI.message "Skipping `#{source.name}` update because the repository is not a git source repository."
63
+ UI.message "Skipping `#{source.name}` update because the repository is not an updateable repository."
44
64
  end
45
65
  end
46
66
  @specs_updated = true
@@ -19,7 +19,10 @@ module Pod
19
19
  env_option :install_with_multi_threads, false
20
20
 
21
21
  # 是否多进程执行 update_repositories
22
- env_option :update_source_with_multi_processes, false
22
+ env_option :update_source_with_multi_threads, false
23
+
24
+ # 并发执行个数
25
+ option :multi_threads_count, 4
23
26
  end
24
27
  end
25
28
  end
@@ -16,70 +16,32 @@ module Pod
16
16
  alias old_install_pod_sources install_pod_sources
17
17
  def install_pod_sources
18
18
  if installation_options.install_with_multi_threads
19
- if Pod.match_version?('~> 1.4.0')
20
- install_pod_sources_for_version_in_1_4_0
21
- elsif Pod.match_version?('~> 1.5')
22
- install_pod_sources_for_version_above_1_5_0
23
- else
24
- old_install_pod_sources
25
- end
19
+ install_pod_sources_with_multiple_threads
26
20
  else
27
21
  old_install_pod_sources
28
22
  end
29
23
  end
30
24
 
31
- # rewrite install_pod_sources
32
- def install_pod_sources_for_version_in_1_4_0
33
- @installed_specs = []
34
- pods_to_install = sandbox_state.added | sandbox_state.changed
35
- title_options = { verbose_prefix: '-> '.green }
36
- Parallel.each(root_specs.sort_by(&:name), in_threads: 4) do |spec|
37
- if pods_to_install.include?(spec.name)
38
- if sandbox_state.changed.include?(spec.name) && sandbox.manifest
39
- previous = sandbox.manifest.version(spec.name)
40
- title = "Installing #{spec.name} #{spec.version} (was #{previous})"
41
- else
42
- title = "Installing #{spec}"
43
- end
44
- UI.titled_section(title.green, title_options) do
45
- install_source_of_pod(spec.name)
46
- end
47
- else
48
- UI.titled_section("Using #{spec}", title_options) do
49
- create_pod_installer(spec.name)
50
- end
51
- end
52
- end
53
- end
54
-
55
- def install_pod_sources_for_version_above_1_5_0
25
+ # 多线程下载
26
+ def install_pod_sources_with_multiple_threads
56
27
  @installed_specs = []
57
28
  pods_to_install = sandbox_state.added | sandbox_state.changed
58
- title_options = { verbose_prefix: '-> '.green }
59
- # 多进程下载,多线程时 log 会显著交叉,多进程好点,但是多进程需要利用文件锁对 cache 进行保护
60
- # in_processes: 10
61
- Parallel.each(root_specs.sort_by(&:name), in_threads: 4) do |spec|
29
+ title_options = { :verbose_prefix => '-> '.green }
30
+ thread_count = installation_options.multi_threads_count
31
+ Parallel.each(root_specs.sort_by(&:name), in_threads: thread_count) do |spec|
62
32
  if pods_to_install.include?(spec.name)
63
33
  if sandbox_state.changed.include?(spec.name) && sandbox.manifest
64
34
  current_version = spec.version
65
35
  previous_version = sandbox.manifest.version(spec.name)
66
36
  has_changed_version = current_version != previous_version
67
- current_repo = analysis_result.specs_by_source.detect do |key, values|
68
- break key if values.map(&:name).include?(spec.name)
69
- end
70
- current_repo &&= current_repo.url || current_repo.name
37
+ current_repo = analysis_result.specs_by_source.detect { |key, values| break key if values.map(&:name).include?(spec.name) }
38
+ current_repo &&= (Pod::TrunkSource::TRUNK_REPO_NAME if current_repo.name == Pod::TrunkSource::TRUNK_REPO_NAME) || current_repo.url || current_repo.name
71
39
  previous_spec_repo = sandbox.manifest.spec_repo(spec.name)
72
- has_changed_repo = !previous_spec_repo.nil? && current_repo && (current_repo != previous_spec_repo)
40
+ has_changed_repo = !previous_spec_repo.nil? && current_repo && !current_repo.casecmp(previous_spec_repo).zero?
73
41
  title = "Installing #{spec.name} #{spec.version}"
74
- if has_changed_version && has_changed_repo
75
- title += " (was #{previous_version} and source changed to `#{current_repo}` from `#{previous_spec_repo}`)"
76
- end
77
- if has_changed_version && !has_changed_repo
78
- title += " (was #{previous_version})"
79
- end
80
- if !has_changed_version && has_changed_repo
81
- title += " (source changed to `#{current_repo}` from `#{previous_spec_repo}`)"
82
- end
42
+ title << " (was #{previous_version} and source changed to `#{current_repo}` from `#{previous_spec_repo}`)" if has_changed_version && has_changed_repo
43
+ title << " (was #{previous_version})" if has_changed_version && !has_changed_repo
44
+ title << " (source changed to `#{current_repo}` from `#{previous_spec_repo}`)" if !has_changed_version && has_changed_repo
83
45
  else
84
46
  title = "Installing #{spec}"
85
47
  end
@@ -87,7 +49,7 @@ module Pod
87
49
  install_source_of_pod(spec.name)
88
50
  end
89
51
  else
90
- UI.titled_section("Using #{spec}", title_options) do
52
+ UI.section("Using #{spec}", title_options[:verbose_prefix]) do
91
53
  create_pod_installer(spec.name)
92
54
  end
93
55
  end
@@ -128,7 +90,15 @@ module Pod
128
90
  # old_ensure_matching_version 会移除不是同一个 CocoaPods 版本的组件缓存
129
91
  alias old_ensure_matching_version ensure_matching_version
130
92
  def ensure_matching_version
131
- @@lock.synchronize { old_ensure_matching_version }
93
+ @@lock.synchronize do
94
+ version_file = root + 'VERSION'
95
+ # version = version_file.read.strip if version_file.file?
96
+
97
+ # root.rmtree if version != Pod::VERSION && root.exist?
98
+ root.mkpath
99
+
100
+ version_file.open('w') { |f| f << Pod::VERSION }
101
+ end
132
102
  end
133
103
  end
134
104
  end
@@ -22,10 +22,7 @@ module Pod
22
22
  alias old_add_swift_library_compatibility_header_phase add_swift_library_compatibility_header_phase
23
23
 
24
24
  def add_swift_library_compatibility_header_phase(native_target)
25
- UI.puts "====== swift add_swift_library_compatibility_header_phase ======".yellow
26
25
  if $ARGV[1] == "auto"
27
- UI.puts "====== auto swift add_swift_library_compatibility_header_phase ======".yellow
28
-
29
26
  if custom_module_map
30
27
  raise Informative, 'Using Swift static libraries with custom module maps is currently not supported. ' \
31
28
  "Please build `#{target.label}` as a framework or remove the custom module map."
@@ -80,13 +77,9 @@ module Pod
80
77
  ${BUILT_PRODUCTS_DIR}/Swift\ Compatibility\ Header/${PRODUCT_MODULE_NAME}-Swift.h
81
78
  )
82
79
  else
83
- UI.puts "====== null swift add_swift_library_compatibility_header_phase ======".yellow
84
80
  old_add_swift_library_compatibility_header_phase(native_target)
85
81
  end
86
-
87
82
  end
88
-
89
- #-----------------------------------------------------------------------#
90
83
  end
91
84
  end
92
85
  end
@@ -189,8 +189,8 @@ module Pod
189
189
 
190
190
  raise Informative, "#{rspec.root.name}(#{spec_version})的podspec未找到,请执行 pod repo update 或添加相应的source源" unless source
191
191
 
192
- UI.message "------------------- 分界线 -----------------------"
193
- UI.message "- 开始处理 #{rspec.spec.name}(#{spec_version}) 组件(#{use_binary ? '二进制' : '源码'})."
192
+ # UI.message "------------------- 分界线 -----------------------"
193
+ # UI.message "- 开始处理 #{rspec.spec.name}(#{spec_version}) 组件(#{use_binary ? '二进制' : '源码'})."
194
194
 
195
195
  begin
196
196
  # 从新 source 中获取 spec,在bin archive中会异常,因为找不到
@@ -219,11 +219,11 @@ module Pod
219
219
  else
220
220
  ResolverSpecification.new(specification, used_by_only, source)
221
221
  end
222
- UI.message "组装新的 rspec ,替换原 rspec #{rspec.root.name} (#{spec_version}) specification = #{specification} #{rspec} "
222
+ # UI.message "组装新的 rspec ,替换原 rspec #{rspec.root.name} (#{spec_version}) specification = #{specification} #{rspec} "
223
223
  rescue Pod::StandardError => e
224
224
  # 没有从新的 source 找到对应版本组件,直接返回原 rspec
225
225
  missing_binary_specs << rspec.spec if use_binary
226
- UI.message "【#{rspec.spec.name} | #{rspec.spec.version}】组件无对应源码版本 , 将采用二进制版本依赖.".red unless use_binary
226
+ # UI.message "【#{rspec.spec.name} | #{rspec.spec.version}】组件无对应源码版本 , 将采用二进制版本依赖.".red unless use_binary
227
227
  rspec
228
228
  end
229
229
  rspec
@@ -232,7 +232,7 @@ module Pod
232
232
 
233
233
  if missing_binary_specs.any?
234
234
  missing_binary_specs.uniq.each do |spec|
235
- UI.message "【#{spec.name} | #{spec.version}】组件无对应二进制版本 , 将采用源码依赖." unless spec.root.source[:type] == 'zip'
235
+ # UI.message "【#{spec.name} | #{spec.version}】组件无对应二进制版本 , 将采用源码依赖." unless spec.root.source[:type] == 'zip'
236
236
  end
237
237
  # 下面的代码为了实现 auto 命令的 --all-make
238
238
  Pod::Command::Bin::Archive.missing_binary_specs(missing_binary_specs)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-mtxx-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-30 00:00:00.000000000 Z
11
+ date: 2022-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel
@@ -108,6 +108,7 @@ files:
108
108
  - lib/cocoapods-mtxx-bin/command/bin/initHotKey.rb
109
109
  - lib/cocoapods-mtxx-bin/command/bin/install.rb
110
110
  - lib/cocoapods-mtxx-bin/command/bin/lib/lint.rb
111
+ - lib/cocoapods-mtxx-bin/command/bin/outputSource.rb
111
112
  - lib/cocoapods-mtxx-bin/command/bin/repo.rb
112
113
  - lib/cocoapods-mtxx-bin/command/bin/repo/push.rb
113
114
  - lib/cocoapods-mtxx-bin/command/bin/repo/update.rb