cocoapods-tdf-bin 0.0.28 → 0.0.31
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 +4 -4
- data/lib/cocoapods-tdf-bin/command/bin/batch.rb +25 -8
- data/lib/cocoapods-tdf-bin/command/bin/spec/push.rb +0 -2
- data/lib/cocoapods-tdf-bin/gem_version.rb +1 -1
- data/lib/cocoapods-tdf-bin/helpers/spec_source_creator.rb +35 -1
- data/lib/cocoapods-tdf-bin/helpers/upload_helper.rb +1 -1
- data/lib/cocoapods-tdf-bin/native/podfile.rb +18 -2
- data/lib/cocoapods-tdf-bin/native/resolver.rb +4 -4
- 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: 52d79d7c48a4fa498edfe0d2a4676363072fbac3d1edcbef40a3885261213f60
|
4
|
+
data.tar.gz: 9f2481c7880b46e3474650aea259d97432d60abfba3cfdaf45af00c07f467d4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e472d730c0ec163ab3ab78c751f5c4ed68e4a401a32771a9e6444a2fc64028ab4e66ae2e4d230aacd0543c4d1dfcd8317466be1cd0b150814eeff2e0bf78d929
|
7
|
+
data.tar.gz: 426600ad46764c5d356a788bdff3ff89487eb146a5e45e0924e5608b6007c98e96a84f98311ddb016bc7d6d8447c0c0528077cda720f0701f2cc10fb644d408f
|
@@ -9,6 +9,11 @@ module Pod
|
|
9
9
|
|
10
10
|
self.summary = "批量操作本地依赖组件的 git 命令"
|
11
11
|
self.description = <<-DESC
|
12
|
+
批量导入的例子:
|
13
|
+
batch_pod [
|
14
|
+
"TDFHomeModule",
|
15
|
+
"TDFLogin",
|
16
|
+
], "../../", :branch => "feature/smallNeeds", :isLocal => true
|
12
17
|
用来批量操作通过 batch_pod_local 本地依赖的组件库,比如 pod bin batch pull, pod bin batch checkout master 等等;
|
13
18
|
操作的是是通过 batch_pod_local 依赖的本地组件
|
14
19
|
DESC
|
@@ -57,23 +62,35 @@ module Pod
|
|
57
62
|
local_pods = podfile_instance.get_batch_local_pods
|
58
63
|
local_pods.each_key do |name|
|
59
64
|
path = local_pods[name][0][:path]
|
65
|
+
branch = local_pods[name][0][:branch]
|
60
66
|
repo_url = Batch.find_repo_with_pod(name)
|
61
67
|
puts "============== #{name} 开始 clone 到 #{path}==============".tdf_blue
|
62
68
|
puts `git clone #{repo_url} #{path}`
|
69
|
+
res = `git -C #{path} checkout #{branch}`
|
70
|
+
puts "imwcl1"
|
71
|
+
puts res
|
72
|
+
if res != 0
|
73
|
+
puts "imwcl2"
|
74
|
+
`git -C #{path} checkout -b #{branch}`
|
75
|
+
end
|
63
76
|
end
|
64
77
|
end
|
65
78
|
|
66
79
|
def run_git(podfile_instance)
|
80
|
+
arg = @arguments.map do |v|
|
81
|
+
match_str = /\s/.match(v)
|
82
|
+
if nil != match_str
|
83
|
+
v = "\"#{v}\""
|
84
|
+
end
|
85
|
+
v
|
86
|
+
end
|
87
|
+
arg = arg.join(" ")
|
88
|
+
|
89
|
+
puts "============== 主工程开始执行 git #{arg} 命令 ==============".tdf_blue
|
90
|
+
puts `git #{arg}`
|
91
|
+
|
67
92
|
podfile_instance.get_batch_local_pods.each_value do |value|
|
68
93
|
path = value[0][:path]
|
69
|
-
arg = @arguments.map do |v|
|
70
|
-
match_str = /\s/.match(v)
|
71
|
-
if nil != match_str
|
72
|
-
v = "\"#{v}\""
|
73
|
-
end
|
74
|
-
v
|
75
|
-
end
|
76
|
-
arg = arg.join(" ")
|
77
94
|
puts "============== #{path} 开始执行 git #{arg} 命令 ==============".tdf_blue
|
78
95
|
puts `git -C #{path} #{arg}`
|
79
96
|
end
|
@@ -165,7 +165,41 @@ module CBin
|
|
165
165
|
spec_hash.delete('resource_bundles')
|
166
166
|
spec_hash.delete('exclude_files')
|
167
167
|
spec_hash.delete('preserve_paths')
|
168
|
-
|
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
|
+
|
169
203
|
# 这里不确定 vendored_libraries 指定的时动态/静态库
|
170
204
|
# 如果是静态库的话,需要移除,否则就不移除
|
171
205
|
# 最好是静态库都独立成 Pod ,cocoapods-package 打静态库去 collect 目标文件时好做过滤
|
@@ -69,7 +69,7 @@ EOF
|
|
69
69
|
argvs = [
|
70
70
|
"#{binary_podsepc_json}",
|
71
71
|
"--binary",
|
72
|
-
"--sources=#{sources_option(@code_dependencies, @sources)}
|
72
|
+
"--sources=#{sources_option(@code_dependencies, @sources)}",
|
73
73
|
"--skip-import-validation",
|
74
74
|
"--use-libraries",
|
75
75
|
"--allow-warnings",
|
@@ -13,10 +13,26 @@ module Pod
|
|
13
13
|
set_internal_hash_value(ALLOW_PRERELEASE, true)
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
16
|
+
def batch_pod(pods, path = "../../", *requirements)
|
17
|
+
isLocal = requirements[0][:isLocal]
|
18
|
+
branch = requirements[0][:branch]
|
19
|
+
if isLocal.nil?
|
20
|
+
isLocal = false
|
21
|
+
end
|
22
|
+
if branch.nil?
|
23
|
+
branch = "master"
|
24
|
+
end
|
25
|
+
if isLocal
|
26
|
+
batch_pod_local(pods, path, branch)
|
27
|
+
else
|
28
|
+
batch_pod_remote(pods, branch)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def batch_pod_local(pods, path = "../../", branch = "master")
|
17
33
|
pod_hash = Hash.new
|
18
34
|
pods.each do |name|
|
19
|
-
pod_hash[name] = [ :path => "#{path}#{name}" ]
|
35
|
+
pod_hash[name] = [ :path => "#{path}#{name}", :branch => branch ]
|
20
36
|
end
|
21
37
|
if get_batch_local_pods.nil?
|
22
38
|
set_internal_hash_value(BATCH_POD_LOCAL, pod_hash)
|
@@ -120,12 +120,12 @@ module Pod
|
|
120
120
|
use_source_pods = podfile.use_source_pods
|
121
121
|
|
122
122
|
# 所有库的个数
|
123
|
-
all_spec_count = 0
|
123
|
+
# all_spec_count = 0
|
124
124
|
|
125
125
|
missing_binary_specs = []
|
126
126
|
specs_by_target.each do |target, rspecs|
|
127
127
|
|
128
|
-
all_spec_count = all_spec_count + rspecs.count
|
128
|
+
# all_spec_count = all_spec_count + rspecs.count
|
129
129
|
|
130
130
|
# use_binaries 并且 use_source_pods 不包含 本地可过滤
|
131
131
|
use_binary_rspecs = if podfile.use_binaries? || podfile.use_binaries_selector
|
@@ -237,8 +237,8 @@ module Pod
|
|
237
237
|
end
|
238
238
|
|
239
239
|
# 二进制库的个数
|
240
|
-
bin_spec_count = all_spec_count - sources_sepc.count
|
241
|
-
UI.message "组件二进制化比例 #{bin_spec_count}/#{all_spec_count}"
|
240
|
+
# bin_spec_count = all_spec_count - sources_sepc.count
|
241
|
+
# UI.message "组件二进制化比例 #{bin_spec_count}/#{all_spec_count}"
|
242
242
|
|
243
243
|
specs_by_target
|
244
244
|
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.31
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gaijiaofan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|