cocoapods-tdf-bin 0.0.24 → 0.0.28

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: b12ad3159d7e92f44ffd550df9bf4d09646c07769d9feea345778edf575ccb8c
4
- data.tar.gz: cc4bee203d36048b9ca59b9e83f10cf5ba2e1bc77458ebd9a4399b046984bcfa
3
+ metadata.gz: 9bdb076bb3b6e381790ebe749eb7c95ec28a50c80d9881dcdba36f2a65fc59b7
4
+ data.tar.gz: 68aad5923bd08c16e4ff9cacc08e8fdb41b4295504affbb306e08524cc65ac4f
5
5
  SHA512:
6
- metadata.gz: 21663273f73583007da2afb7c44fdfbe7dd287b4e402f3ec9887b89affbe7b4646fc8674a3cabd302534e93678b2b6822e98d4ca50a6f952b2a98378bb481d3f
7
- data.tar.gz: 90212296c1ecde617fe82904aee89e295770f02467678a3fa8f2eb8076e22fc6b6da71c3268074c9178f1a2525f830a7cad8a4a4be1dd18bbf8119970357114e
6
+ metadata.gz: 40db87d009cb7925f78947f40aa2bfaa32fe6bae59df182dab8ec99a61bb7a3cb906c4b43fb95dcb0adc7654709ac42933d7a1c6f65c955dee1ae2cd3a223107
7
+ data.tar.gz: ad74c200ef28f06b6f2f9cbf63dbb464c0ca628092b6b22be36bc2e85ede55c8a3ccb30125f4e2d3d9811a8ec1c22ba59c6cb89e56448e4fee3f5a6b99f0b349
data/README.md CHANGED
@@ -4,7 +4,7 @@ cocoapods-tdf-bin功能点:
4
4
 
5
5
  - 组件二进制化,`无入侵式`支持组件二进制化,完全自动化,无需手动操作。致力于解决Ci打包速度慢、研发编译慢等编译问题。
6
6
 
7
- cocoapods-imy-bin插件所关联的组件二进制化策略:
7
+ cocoapods-tdf-bin插件所关联的组件二进制化策略:
8
8
 
9
9
  - 预先将打包成 `.framework` 的组件保存到静态服务器上,并在 `install` 时,去下载组件对应的二进制版本,以减少组件编译时间,达到加快 App 打包、组件发布等操作的目的。
10
10
 
@@ -99,5 +99,18 @@ set_use_source_pods [
99
99
  ]
100
100
  ```
101
101
 
102
+ #### 5. 使用 batch 命令
103
+ ```ruby
104
+ batch_pod_local [
105
+ "TDFSunKitchenModule",
106
+ "TDFRetailStock",
107
+ ], "本地路径"
108
+
109
+ batch_pod_remote [
110
+ "TDFSunKitchenModule",
111
+ "TDFRetailStock",
112
+ ], "分支名"
113
+ ```
114
+
102
115
 
103
116
 
@@ -27,11 +27,13 @@ module Pod
27
27
  end
28
28
 
29
29
  def run
30
+
30
31
  podfile = File.join(Pathname.pwd, "Podfile")
31
32
  podfile_instance = Pod::Podfile.from_file(podfile)
32
33
  if podfile_instance.get_batch_local_pods == nil
33
34
  help! "没有本地依赖的组件"
34
35
  end
36
+
35
37
  if @arguments.size == 1 && @arguments[0] == "clone"
36
38
  clone_all(podfile_instance)
37
39
  elsif @arguments.size == 1 && @arguments[0] == "done"
@@ -55,7 +57,7 @@ module Pod
55
57
  local_pods = podfile_instance.get_batch_local_pods
56
58
  local_pods.each_key do |name|
57
59
  path = local_pods[name][0][:path]
58
- repo_url = find_repo_with_pod(name)
60
+ repo_url = Batch.find_repo_with_pod(name)
59
61
  puts "============== #{name} 开始 clone 到 #{path}==============".tdf_blue
60
62
  puts `git clone #{repo_url} #{path}`
61
63
  end
@@ -83,12 +85,10 @@ module Pod
83
85
  group_map = {}
84
86
  local_pods.each_key do |name|
85
87
  path = local_pods[name][0][:path]
86
- git_url = `git -C #{path} remote get-url --push origin`
87
88
  current_branch = `git -C #{path} branch --show-current`.delete!("\n")
88
- group_name = get_group_with_repo(git_url)
89
- puts "============== #{name} 当前分支 #{current_branch} 当前组 #{group_name} ==============".tdf_blue
89
+ puts "============== #{name} 当前分支 #{current_branch} ==============".tdf_blue
90
90
 
91
- group_key = "#{group_name}&&#{current_branch}"
91
+ group_key = "#{current_branch}"
92
92
  repo_arr = group_map[group_key]
93
93
  if repo_arr.is_a? Array
94
94
  repo_arr << name
@@ -106,9 +106,8 @@ module Pod
106
106
  pod_names.each do |name|
107
107
  pod_remote_str << " \"#{name}\",\n"
108
108
  end
109
- group = key.split("&&")[0]
110
- branch = key.split("&&")[1]
111
- pod_remote_str << " ], \"#{branch}\", \"#{group}\" \n\n"
109
+ branch = key
110
+ pod_remote_str << " ], \"#{branch}\" \n"
112
111
  end
113
112
  puts "将 local_batch 依赖 替换为 \n#{pod_remote_str}".tdf_blue
114
113
 
@@ -133,8 +132,8 @@ module Pod
133
132
  puts "替换成功".tdf_blue
134
133
  end
135
134
 
136
- def find_repo_with_pod(pod_name)
137
- sources = config.sources_manager.all
135
+ def self.find_repo_with_pod(pod_name)
136
+ sources = Config.instance.sources_manager.all
138
137
  sources = sources.select do |s|
139
138
  s.name == "2dfire-cocoapods-spec"
140
139
  end
@@ -151,18 +150,7 @@ module Pod
151
150
  git_url
152
151
  end
153
152
 
154
- def get_group_with_repo(repo_url)
155
- if repo_url.start_with?("http")
156
- re = Regexp.new("git.2dfire.net/.*/")
157
- repo_group = repo_url.match(re)[0][15..-2]
158
- else
159
- re = Regexp.new("git.2dfire.net:.*/")
160
- repo_group = repo_url.match(re)[0][15..-2]
161
- end
162
- repo_group
163
- end
164
-
165
- private :clone_all, :run_git, :find_repo_with_pod, :done_all, :get_group_with_repo
153
+ private :clone_all, :run_git, :done_all
166
154
 
167
155
  end
168
156
  end
@@ -59,6 +59,8 @@ module Pod
59
59
  end
60
60
  end
61
61
 
62
+ argvs << '--verbose'
63
+
62
64
  push = Pod::Command::Repo::Push.new(CLAide::ARGV.new(argvs))
63
65
  push.validate!
64
66
  push.run
@@ -12,8 +12,8 @@ module CBin
12
12
  def template_hash
13
13
  {
14
14
  'configuration_env' => { description: '编译环境', default: 'dev', selection: %w[dev debug_iphoneos release_iphoneos] },
15
- 'code_repo_url' => { description: '源码私有源 Git 地址', default: 'git@git.2dfire.net:ios/cocoapods-spec.git' },
16
- 'binary_repo_url' => { description: '二进制私有源 Git 地址', default: 'git@git.2dfire.net:ios/cocoapods-spec-binary.git' },
15
+ 'code_repo_url' => { description: '源码私有源 Git 地址', default: 'git@git.2dfire.net:app/cocoapods-spec/cocoapods-spec.git' },
16
+ 'binary_repo_url' => { description: '二进制私有源 Git 地址', default: 'git@git.2dfire.net:app/cocoapods-spec-binary/cocoapods-spec-binary.git' },
17
17
  'binary_download_url' => { description: '二进制下载地址,内部会依次传入组件名称与版本,替换字符串中的 %s ', default: 'http://iosframeworkserver-shopkeeperclient.app.2dfire.com/download/%s/%s.zip' },
18
18
  'binary_upload_url' => { description: '二进制下载地址,内部会依次传入组件名称与版本,替换字符串中的 %s ', default: 'http://iosframeworkserver-shopkeeperclient.app.2dfire.com/upload/%s/%s.zip' },
19
19
  # 'binary_type' => { description: '二进制打包类型', default: 'framework', selection: %w[framework library] },
@@ -1,6 +1,6 @@
1
1
 
2
2
  module CBin
3
- VERSION = '0.0.24'
3
+ VERSION = '0.0.28'
4
4
  end
5
5
 
6
6
  module Pod
@@ -55,7 +55,7 @@ module CBin
55
55
  source_dir = Dir.pwd
56
56
  file_accessor = Sandbox::FileAccessor.new(Pathname.new('.').expand_path, @spec.consumer(@platform))
57
57
  Dir.chdir(workspace_directory) do
58
- builder = CBin::Framework::Builder.new(@spec, file_accessor, @platform, source_dir, @isRootSpec, @build_model )
58
+ builder = CBin::Framework::Builder.new(@spec, file_accessor, @platform, source_dir, @isRootSpec, @build_model)
59
59
  @@build_defines = builder.build if @isRootSpec
60
60
  begin
61
61
  @framework_path = builder.lipo_build(@@build_defines) unless @skip_archive
@@ -118,7 +118,8 @@ module CBin
118
118
  end
119
119
 
120
120
  def framework_name
121
- CBin::Config::Builder.instance.framework_name(@spec)
121
+ @spec.name + ".xcframework"
122
+ # CBin::Config::Builder.instance.framework_name(@spec)
122
123
  end
123
124
 
124
125
  def framework_name_zip
@@ -7,6 +7,7 @@ module CBin
7
7
  class Utils
8
8
 
9
9
  def Utils.is_framework(spec)
10
+ # 目前全部打包成 静态 framework
10
11
  return true
11
12
  # if Utils.uses_frameworks?
12
13
  # return true
@@ -40,11 +40,13 @@ module CBin
40
40
  def lipo_build(defines)
41
41
  UI.section("Building static Library #{@spec}") do
42
42
 
43
- cp_framework_to_source_dir
44
- build_static_library_for_ios
43
+ # cp_framework_to_source_dir
44
+ build_xcframework_for_ios
45
+ # build_static_library_for_ios
45
46
 
46
47
  copy_resources
47
48
 
49
+ # link_header
48
50
  end
49
51
  framework
50
52
  end
@@ -53,7 +55,6 @@ module CBin
53
55
 
54
56
  def cp_framework_to_source_dir
55
57
  framework_name = "#{@spec.name}.framework"
56
- framework_dir = "./build-armv7/#{framework_name}" if File.exist?('./build-armv7')
57
58
  framework_dir = "./build-arm64/#{framework_name}" if File.exist?('./build-arm64')
58
59
  target_dir = File.join(CBin::Config::Builder.instance.zip_dir,framework_name)
59
60
 
@@ -81,7 +82,7 @@ module CBin
81
82
  # archs = %w[i386 x86_64]
82
83
  archs = ios_architectures_sim
83
84
  archs.map do |arch|
84
- xcodebuild(defines, "-sdk iphonesimulator ARCHS=\'#{arch}\' ", "build-#{arch}",@build_model)
85
+ xcodebuild(defines, "-sdk iphonesimulator ARCHS=\'#{arch}\' ", "build-#{arch}", @build_model)
85
86
  end
86
87
  end
87
88
 
@@ -94,6 +95,28 @@ module CBin
94
95
  file
95
96
  end
96
97
 
98
+ =begin
99
+ 制作 xcframework
100
+ =end
101
+ def build_xcframework_for_ios
102
+ UI.message "Building ios libraries with archs #{ios_architectures}"
103
+
104
+ framework_name = "#{@spec.name}.xcframework"
105
+ output = File.join(CBin::Config::Builder.instance.zip_dir,framework_name)
106
+
107
+ build_path = Pathname("build")
108
+ build_path.path unless build_path.exist?
109
+
110
+ # if is_debug_model
111
+ libs = (ios_architectures + ios_architectures_sim) .map do |arch|
112
+ library = "-framework build-#{arch}/#{@spec.name}.framework"
113
+ library
114
+ end
115
+
116
+ UI.message "xcodebuild -create-xcframework #{libs.join(' ')} -output #{output}"
117
+ `xcodebuild -create-xcframework #{libs.join(' ')} -output #{output}`
118
+ end
119
+
97
120
  =begin
98
121
  lipo合并 二进制
99
122
  =end
@@ -133,7 +156,7 @@ module CBin
133
156
  # iphone5,iphone5s以下的模拟器
134
157
  # >x86_64
135
158
  # iphone6以上的模拟器
136
- archs = %w[arm64 armv7]
159
+ archs = %w[arm64]
137
160
  # archs = %w[x86_64 arm64 armv7s i386]
138
161
  # @vendored_libraries.each do |library|
139
162
  # archs = `lipo -info #{library}`.split & archs
@@ -202,12 +225,22 @@ module CBin
202
225
  end
203
226
  end
204
227
 
228
+ def link_header
229
+ header_dir = "#{CBin::Config::Builder.instance.zip_dir}/#{@spec.name}.xcframework/ios-arm64/#{@spec.name}.framework/Headers"
230
+ target_headers_dir = "#{CBin::Config::Builder.instance.zip_dir}/#{@spec.name}.xcframework/Headers"
231
+ FileUtils.mkdir_p(target_headers_dir) unless File.exist?(target_headers_dir)
232
+ Dir.foreach(header_dir) do |file|
233
+ if file !="." and file !=".."
234
+ `ln -s #{header_dir}/#{file} #{target_headers_dir}`
235
+ end
236
+ end
237
+ end
238
+
205
239
  def copy_resources
206
240
  resource_dir = './build/*.bundle'
207
- resource_dir = './build-armv7/*.bundle' if File.exist?('./build-armv7')
208
241
  resource_dir = './build-arm64/*.bundle' if File.exist?('./build-arm64')
209
242
 
210
- framework_name = "#{@spec.name}.framework"
243
+ framework_name = "#{@spec.name}.xcframework"
211
244
  resource_target_dir = File.join(CBin::Config::Builder.instance.zip_dir,framework_name,"Resources")
212
245
 
213
246
  FileUtils.mkdir_p(resource_target_dir) unless File.exist?(resource_target_dir)
@@ -267,8 +300,11 @@ module CBin
267
300
  not expand_suffix(suffix)
268
301
  end
269
302
 
270
- UI.message "Copying resources #{escape_resource_arr}"
271
- `cp -rp #{escape_resource_arr.join(' ')} #{resource_target_dir}`
303
+ if escape_resource_arr.count > 0
304
+ UI.message "Copying resources #{escape_resource_arr}"
305
+ `cp -rp #{escape_resource_arr.join(' ')} #{resource_target_dir}`
306
+ end
307
+
272
308
  end
273
309
  end
274
310
 
@@ -59,7 +59,7 @@ module CBin
59
59
  # license | resource_bundles | vendored_libraries
60
60
 
61
61
  # Project Linkin
62
- @spec.vendored_frameworks = "#{code_spec.root.name}.framework"
62
+ @spec.vendored_frameworks = "#{code_spec.root.name}.xcframework"
63
63
 
64
64
  # Resources
65
65
  extnames = []
@@ -75,8 +75,8 @@ module CBin
75
75
  @spec.source = binary_source
76
76
 
77
77
  # Source Code
78
- @spec.source_files = framework_contents('Headers/*')
79
- @spec.public_header_files = framework_contents('Headers/*')
78
+ # @spec.source_files = framework_contents('Headers/*')
79
+ # @spec.public_header_files = framework_contents('Headers/*')
80
80
 
81
81
  # Unused for binary
82
82
  spec_hash = @spec.to_hash
@@ -131,7 +131,7 @@ module CBin
131
131
  end
132
132
 
133
133
  def framework_contents(name)
134
- ["#{code_spec.root.name}.framework"].map { |path| "#{path}/#{name}" }
134
+ ["#{code_spec.root.name}.xcframework"].map { |path| "#{path}/#{name}" }
135
135
  end
136
136
 
137
137
  def binary_source_files
@@ -63,9 +63,9 @@ module CBin
63
63
 
64
64
  # Resources
65
65
  extnames = []
66
- extnames << '*.bundle' if code_spec_consumer.resource_bundles.any?
67
- if code_spec_consumer.resources.any?
68
- extnames += code_spec_consumer.resources.map { |r| File.basename(r) }
66
+ extnames << '*.bundle' if contain_bundles
67
+ if code_spec_resource.any?
68
+ extnames += code_spec_resource.map { |r| File.basename(r) }
69
69
  end
70
70
  if extnames.any?
71
71
  @spec.resources = framework_contents('Resources').flat_map { |r| extnames.map { |e| "#{r}/#{e}" } }
@@ -132,13 +132,13 @@ module CBin
132
132
  # license | resource_bundles | vendored_libraries
133
133
 
134
134
  # Project Linkin
135
- @spec.vendored_frameworks = "#{code_spec.root.name}.framework"
135
+ @spec.vendored_frameworks = "#{code_spec.root.name}.xcframework"
136
136
 
137
137
  # Resources
138
138
  extnames = []
139
- extnames << '*.bundle' if code_spec_consumer.resource_bundles.any?
140
- if code_spec_consumer.resources.any?
141
- extnames += code_spec_consumer.resources.map { |r| File.basename(r) }
139
+ extnames << '*.bundle' if contain_bundles
140
+ if code_spec_resource.any?
141
+ extnames += code_spec_resource.map { |r| File.basename(r) }
142
142
  end
143
143
 
144
144
  extnames = extnames.select do | extname |
@@ -147,7 +147,7 @@ module CBin
147
147
 
148
148
  if extnames.any?
149
149
  resources = framework_contents('Resources').flat_map { |r| extnames.map { |e| "#{r}/#{e}" } }
150
- resources << "#{code_spec.root.name}.framework/*.{storyboardc,nib,mom,momd,cdm}"
150
+ resources << "#{code_spec.root.name}.xcframework/ios-arm64/#{code_spec.root.name}.framework/*.{storyboardc,nib,mom,momd,cdm}"
151
151
  @spec.resources = resources
152
152
  end
153
153
 
@@ -155,8 +155,9 @@ module CBin
155
155
  @spec.source = binary_source
156
156
 
157
157
  # Source Code
158
- @spec.source_files = framework_contents('Headers/*')
159
- @spec.public_header_files = framework_contents('Headers/*')
158
+ # @spec.source_files = framework_contents("Headers/*.h")
159
+ # @spec.public_header_files = framework_contents("ios-arm64/#{code_spec.root.name}.framework/Headers/*.h")
160
+ # @spec.header_mappings_dir = "#{code_spec.root.name}.xcframework/ios-arm64/#{code_spec.root.name}.framework/Headers"
160
161
 
161
162
  # Unused for binary
162
163
  spec_hash = @spec.to_hash
@@ -164,6 +165,7 @@ module CBin
164
165
  spec_hash.delete('resource_bundles')
165
166
  spec_hash.delete('exclude_files')
166
167
  spec_hash.delete('preserve_paths')
168
+ # spec_hash.delete('source_files')
167
169
  # 这里不确定 vendored_libraries 指定的时动态/静态库
168
170
  # 如果是静态库的话,需要移除,否则就不移除
169
171
  # 最好是静态库都独立成 Pod ,cocoapods-package 打静态库去 collect 目标文件时好做过滤
@@ -189,6 +191,18 @@ module CBin
189
191
  @spec
190
192
  end
191
193
 
194
+ def contain_bundles
195
+ consumers = [code_spec, *code_spec.recursive_subspecs].flat_map do |spec|
196
+ spec.consumer(:ios)
197
+ end
198
+ for consumer in consumers
199
+ if consumer.resource_bundles.any?
200
+ return true
201
+ end
202
+ end
203
+ return false
204
+ end
205
+
192
206
  def expand_suffix(suffix)
193
207
  if suffix.end_with?('.storyboard') ||
194
208
  suffix.end_with?('.xib') ||
@@ -204,12 +218,15 @@ module CBin
204
218
  { http: format(CBin.config.binary_download_url, code_spec.root.name, code_spec.version), type: CBin.config.download_file_type }
205
219
  end
206
220
 
207
- def code_spec_consumer(_platform = :ios)
208
- code_spec.consumer(:ios)
221
+ def code_spec_resource
222
+ resources = [code_spec, *code_spec.recursive_subspecs].flat_map do |spec|
223
+ spec.consumer(:ios).resources
224
+ end.compact.uniq
225
+ resources
209
226
  end
210
227
 
211
228
  def framework_contents(name)
212
- ["#{code_spec.root.name}.framework"].map { |path| "#{path}/#{name}" }
229
+ ["#{code_spec.root.name}.xcframework"].map { |path| "#{path}/#{name}" }
213
230
  end
214
231
 
215
232
  def binary_source_files
@@ -8,6 +8,7 @@ require 'cocoapods/generate'
8
8
  require 'cocoapods-tdf-bin/helpers/framework_builder'
9
9
  require 'cocoapods-tdf-bin/helpers/library_builder'
10
10
  require 'cocoapods-tdf-bin/helpers/sources_helper'
11
+ require 'cocoapods-tdf-bin/helpers/spec_source_creator'
11
12
  require 'cocoapods-tdf-bin/command/bin/spec/push'
12
13
 
13
14
  module CBin
@@ -47,7 +48,7 @@ module CBin
47
48
  # curl http://ci.xxx:9192/frameworks -F "name=IMYFoundation" -F "version=7.7.4.2" -F "annotate=IMYFoundation_7.7.4.2_log" -F "file=@bin-zip/bin_IMYFoundation_7.7.4.2.zip"
48
49
  def curl_framework
49
50
 
50
- zip_file = "#{CBin::Config::Builder.instance.zip_dir}/#{@spec.name}.framework.zip"
51
+ zip_file = "#{CBin::Config::Builder.instance.zip_dir}/#{@spec.name}.xcframework.zip"
51
52
  res = File.exist?(zip_file)
52
53
  if res
53
54
  command = "curl #{CBin.config.bin_upload_url} -F \"frameworkName=#{@spec.name}\" -F \"version=#{@spec.version}\" -F \"changelog=#{@spec.name}_#{@spec.version}_log\" -F \"framework=@#{zip_file}\""
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'cocoapods'
4
4
  require 'cocoapods-tdf-bin/native/podfile_env'
5
+ require 'cocoapods-tdf-bin/command/bin/batch'
5
6
 
6
7
  module Pod
7
8
  class Podfile
@@ -24,10 +25,11 @@ module Pod
24
25
  end
25
26
  end
26
27
 
27
- def batch_pod_remote(pods, branch , group = 'ios')
28
+ def batch_pod_remote(pods, branch)
28
29
  pod_hash = Hash.new
29
30
  pods.each do |name|
30
- pod_hash[name] = [ :git => "git@git.2dfire.net:#{group}/#{name}.git", :branch => "#{branch}" ]
31
+ git_url = Pod::Command::Bin::Batch.find_repo_with_pod(name)
32
+ pod_hash[name] = [ :git => git_url, :branch => "#{branch}" ]
31
33
  end
32
34
  if get_batch_remote_pods.nil?
33
35
  set_internal_hash_value(BATCH_POD_REMOTE, pod_hash)
@@ -135,5 +137,6 @@ module Pod
135
137
  def get_internal_hash_value(key, default = nil)
136
138
  internal_hash.fetch(key, default)
137
139
  end
140
+
138
141
  end
139
142
  end
@@ -119,8 +119,14 @@ module Pod
119
119
  sources_manager = Config.instance.sources_manager
120
120
  use_source_pods = podfile.use_source_pods
121
121
 
122
+ # 所有库的个数
123
+ all_spec_count = 0
124
+
122
125
  missing_binary_specs = []
123
126
  specs_by_target.each do |target, rspecs|
127
+
128
+ all_spec_count = all_spec_count + rspecs.count
129
+
124
130
  # use_binaries 并且 use_source_pods 不包含 本地可过滤
125
131
  use_binary_rspecs = if podfile.use_binaries? || podfile.use_binaries_selector
126
132
  rspecs.select do |rspec|
@@ -222,7 +228,7 @@ module Pod
222
228
  end
223
229
  next if spec_git_res
224
230
 
225
- #获取没有制作二进制版本的spec集合
231
+ # 获取没有制作二进制版本的spec集合
226
232
  sources_sepc << spec
227
233
  unless spec.defined_in_file.nil?
228
234
  FileUtils.cp("#{spec.defined_in_file}", "#{des_dir}")
@@ -230,6 +236,10 @@ module Pod
230
236
  end
231
237
  end
232
238
 
239
+ # 二进制库的个数
240
+ bin_spec_count = all_spec_count - sources_sepc.count
241
+ UI.message "组件二进制化比例 #{bin_spec_count}/#{all_spec_count}"
242
+
233
243
  specs_by_target
234
244
  end
235
245
  end
@@ -13,28 +13,70 @@ module Pod
13
13
  #
14
14
  # Perform analysis for a given spec (or subspec)
15
15
  #
16
- def perform_extensive_analysis(spec)
17
- return true
18
- end
16
+ # def perform_extensive_analysis(spec)
17
+ # return true
18
+ # end
19
19
 
20
20
  #覆盖
21
- def check_file_patterns
22
- FILE_PATTERNS.each do |attr_name|
23
- next if %i(source_files resources).include? attr_name
24
- if respond_to?("_validate_#{attr_name}", true)
25
- send("_validate_#{attr_name}")
26
- else
27
- validate_nonempty_patterns(attr_name, :error)
21
+ # def check_file_patterns
22
+ # FILE_PATTERNS.each do |attr_name|
23
+ # next if %i(source_files resources).include? attr_name
24
+ # if respond_to?("_validate_#{attr_name}", true)
25
+ # send("_validate_#{attr_name}")
26
+ # else
27
+ # validate_nonempty_patterns(attr_name, :error)
28
+ # end
29
+ # end
30
+ #
31
+ # _validate_header_mappings_dir
32
+ # if consumer.spec.root?
33
+ # _validate_license
34
+ # _validate_module_map
35
+ # end
36
+ # end
37
+
38
+ # def validate_source_url(spec); end
39
+
40
+ # 修改 验证 build 时的 ARCHS 配置
41
+ def xcodebuild(action, scheme, configuration, deployment_target:)
42
+ require 'fourflusher'
43
+ command = %W(clean #{action} -workspace #{File.join(validation_dir, 'App.xcworkspace')} -scheme #{scheme} -configuration #{configuration})
44
+ case consumer.platform_name
45
+ when :osx, :macos
46
+ command += %w(CODE_SIGN_IDENTITY=)
47
+ when :ios
48
+ command += %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator)
49
+ command += Fourflusher::SimControl.new.destination(:oldest, 'iOS', deployment_target)
50
+ command += %w(ARCHS=x86_64)
51
+ xcconfig = consumer.pod_target_xcconfig
52
+ if xcconfig
53
+ archs = xcconfig['VALID_ARCHS']
54
+ if archs && (archs.include? 'armv7') && !(archs.include? 'i386') && (archs.include? 'x86_64')
55
+ # Prevent Xcodebuild from testing the non-existent i386 simulator if armv7 is specified without i386
56
+ command += %w(ARCHS=x86_64)
28
57
  end
58
+ end
59
+ when :watchos
60
+ command += %w(CODE_SIGN_IDENTITY=- -sdk watchsimulator)
61
+ command += Fourflusher::SimControl.new.destination(:oldest, 'watchOS', deployment_target)
62
+ when :tvos
63
+ command += %w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator)
64
+ command += Fourflusher::SimControl.new.destination(:oldest, 'tvOS', deployment_target)
65
+ end
66
+
67
+ if analyze
68
+ command += %w(CLANG_ANALYZER_OUTPUT=html CLANG_ANALYZER_OUTPUT_DIR=analyzer)
29
69
  end
30
70
 
31
- _validate_header_mappings_dir
32
- if consumer.spec.root?
33
- _validate_license
34
- _validate_module_map
71
+ begin
72
+ _xcodebuild(command, true)
73
+ rescue => e
74
+ message = 'Returned an unsuccessful exit code.'
75
+ message += ' You can use `--verbose` for more information.' unless config.verbose?
76
+ error('xcodebuild', message)
77
+ e.message
35
78
  end
36
79
  end
37
80
 
38
- def validate_source_url(spec); end
39
81
  end
40
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-tdf-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.24
4
+ version: 0.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - gaijiaofan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-30 00:00:00.000000000 Z
11
+ date: 2022-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel