cocoapods-tdf-bin 0.0.25 → 0.0.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -1
- data/lib/cocoapods-tdf-bin/command/bin/batch.rb +2 -0
- data/lib/cocoapods-tdf-bin/command/bin/spec/push.rb +2 -0
- data/lib/cocoapods-tdf-bin/config/config.rb +2 -2
- data/lib/cocoapods-tdf-bin/gem_version.rb +1 -1
- data/lib/cocoapods-tdf-bin/helpers/build_helper.rb +3 -2
- data/lib/cocoapods-tdf-bin/helpers/build_utils.rb +1 -0
- data/lib/cocoapods-tdf-bin/helpers/framework_builder.rb +45 -9
- data/lib/cocoapods-tdf-bin/helpers/spec_creator.rb +4 -4
- data/lib/cocoapods-tdf-bin/helpers/spec_source_creator.rb +64 -13
- data/lib/cocoapods-tdf-bin/helpers/upload_helper.rb +3 -2
- data/lib/cocoapods-tdf-bin/native/resolver.rb +11 -1
- data/lib/cocoapods-tdf-bin/native/validator.rb +57 -15
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 965e339f8eea15bcc092ce5aec87779766eaf08b0ef2b149e656fb99f9b3ee3d
|
4
|
+
data.tar.gz: 8a886b055ee958714e9375a299adc02e7dff365556991f34c62d79ff65033502
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38eeb96491f2c9f4bcd6a0bf46c2fcf1027849e858795a1d8de29c23e8514f87cd8f9930a1e7739f5a7e54ddc96c29042929faa55c1d931d935c156d8ae4b999
|
7
|
+
data.tar.gz: 627146df6541bc5cd4858f23350a9c329bca13cdb90c775038e521e21f98c90a1b975645bbea4fdc0623462bb823f1b717c1e2d7c15c9cdace44e89458843910
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ cocoapods-tdf-bin功能点:
|
|
4
4
|
|
5
5
|
- 组件二进制化,`无入侵式`支持组件二进制化,完全自动化,无需手动操作。致力于解决Ci打包速度慢、研发编译慢等编译问题。
|
6
6
|
|
7
|
-
cocoapods-
|
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"
|
@@ -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:
|
16
|
-
'binary_repo_url' => { description: '二进制私有源 Git 地址', default: 'git@git.2dfire.net:
|
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] },
|
@@ -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
|
-
|
121
|
+
@spec.name + ".xcframework"
|
122
|
+
# CBin::Config::Builder.instance.framework_name(@spec)
|
122
123
|
end
|
123
124
|
|
124
125
|
def framework_name_zip
|
@@ -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
|
-
|
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}"
|
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
|
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}.
|
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
|
-
|
271
|
-
|
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}.
|
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}.
|
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
|
67
|
-
if
|
68
|
-
extnames +=
|
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}.
|
135
|
+
@spec.vendored_frameworks = "#{code_spec.root.name}.xcframework"
|
136
136
|
|
137
137
|
# Resources
|
138
138
|
extnames = []
|
139
|
-
extnames << '*.bundle' if
|
140
|
-
if
|
141
|
-
extnames +=
|
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(
|
159
|
-
@spec.public_header_files = framework_contents(
|
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,41 @@ 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')
|
169
|
+
|
170
|
+
# 处理子库,将二进制子库的依赖全部放到最外层,删除子库的source_files
|
171
|
+
dependencies = Hash(spec_hash["dependencies"])
|
172
|
+
sub_specs = spec_hash["subspecs"]
|
173
|
+
if sub_specs != nil
|
174
|
+
sub_specs.each { |suc_spec|
|
175
|
+
begin
|
176
|
+
deps_hash = suc_spec["dependencies"]
|
177
|
+
# 删除二进制下无用的字段,目前只支持 ios 架构
|
178
|
+
suc_spec["vendored_frameworks"] = spec_hash["vendored_frameworks"]
|
179
|
+
suc_spec.delete('source_files')
|
180
|
+
suc_spec.delete('dependencies')
|
181
|
+
suc_spec.delete('osx')
|
182
|
+
suc_spec.delete('tvos')
|
183
|
+
suc_spec.delete('watchos')
|
184
|
+
platforms = suc_spec["platforms"]
|
185
|
+
platforms.delete('osx')
|
186
|
+
platforms.delete('tvos')
|
187
|
+
platforms.delete('watchos')
|
188
|
+
if deps_hash != nil
|
189
|
+
dependencies = dependencies.merge(deps_hash)
|
190
|
+
end
|
191
|
+
rescue
|
192
|
+
end
|
193
|
+
}
|
194
|
+
end
|
195
|
+
|
196
|
+
# 去重自己对自己的依赖
|
197
|
+
dependencies = dependencies.reject do |d|
|
198
|
+
d.start_with?("#{@spec.name}/")
|
199
|
+
end
|
200
|
+
spec_hash["dependencies"] = dependencies
|
201
|
+
spec_hash["subspecs"] = sub_specs
|
202
|
+
|
167
203
|
# 这里不确定 vendored_libraries 指定的时动态/静态库
|
168
204
|
# 如果是静态库的话,需要移除,否则就不移除
|
169
205
|
# 最好是静态库都独立成 Pod ,cocoapods-package 打静态库去 collect 目标文件时好做过滤
|
@@ -189,6 +225,18 @@ module CBin
|
|
189
225
|
@spec
|
190
226
|
end
|
191
227
|
|
228
|
+
def contain_bundles
|
229
|
+
consumers = [code_spec, *code_spec.recursive_subspecs].flat_map do |spec|
|
230
|
+
spec.consumer(:ios)
|
231
|
+
end
|
232
|
+
for consumer in consumers
|
233
|
+
if consumer.resource_bundles.any?
|
234
|
+
return true
|
235
|
+
end
|
236
|
+
end
|
237
|
+
return false
|
238
|
+
end
|
239
|
+
|
192
240
|
def expand_suffix(suffix)
|
193
241
|
if suffix.end_with?('.storyboard') ||
|
194
242
|
suffix.end_with?('.xib') ||
|
@@ -204,12 +252,15 @@ module CBin
|
|
204
252
|
{ http: format(CBin.config.binary_download_url, code_spec.root.name, code_spec.version), type: CBin.config.download_file_type }
|
205
253
|
end
|
206
254
|
|
207
|
-
def
|
208
|
-
code_spec.
|
255
|
+
def code_spec_resource
|
256
|
+
resources = [code_spec, *code_spec.recursive_subspecs].flat_map do |spec|
|
257
|
+
spec.consumer(:ios).resources
|
258
|
+
end.compact.uniq
|
259
|
+
resources
|
209
260
|
end
|
210
261
|
|
211
262
|
def framework_contents(name)
|
212
|
-
["#{code_spec.root.name}.
|
263
|
+
["#{code_spec.root.name}.xcframework"].map { |path| "#{path}/#{name}" }
|
213
264
|
end
|
214
265
|
|
215
266
|
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}.
|
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}\""
|
@@ -68,7 +69,7 @@ EOF
|
|
68
69
|
argvs = [
|
69
70
|
"#{binary_podsepc_json}",
|
70
71
|
"--binary",
|
71
|
-
"--sources=#{sources_option(@code_dependencies, @sources)}
|
72
|
+
"--sources=#{sources_option(@code_dependencies, @sources)}",
|
72
73
|
"--skip-import-validation",
|
73
74
|
"--use-libraries",
|
74
75
|
"--allow-warnings",
|
@@ -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
|
-
|
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
|
-
|
18
|
-
end
|
16
|
+
# def perform_extensive_analysis(spec)
|
17
|
+
# return true
|
18
|
+
# end
|
19
19
|
|
20
20
|
#覆盖
|
21
|
-
def check_file_patterns
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
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
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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.
|
4
|
+
version: 0.0.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gaijiaofan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|