cocoapods-freezer 1.0.6 → 1.0.7
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/README_CH.md +10 -10
- data/lib/cocoapods-freezer/freezer.rb +77 -111
- data/lib/cocoapods-freezer/gem_version.rb +1 -1
- data/lib/cocoapods-freezer/installer.rb +14 -19
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21166efd3df3dbcfdacf250b9c679f996f16f481
|
4
|
+
data.tar.gz: 8719db832ee221b5995e411508a0b347ed5dbd91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eba6c6144d398fab7a60ea551a3698bb55a5154f21177fd6fd734581d42c72dd7cb8f83935ea629291270df86643abbb80a3663e3a9f44b49237a479db18a8e9
|
7
|
+
data.tar.gz: 114d4fc5e6075506ce076aa8d4a572e887d6e9208ca8f3395c404b147401daebf88c2db8c9438baf5184c3f22bde8df6b0b83cccedfb59039fb31e695501e5d2
|
data/README_CH.md
CHANGED
@@ -31,17 +31,17 @@ $ pod install --user-freezer
|
|
31
31
|
## 计划
|
32
32
|
|
33
33
|
- 预编译相关
|
34
|
-
|
35
|
-
[]
|
36
|
-
[] 支持
|
37
|
-
[] 支持
|
38
|
-
|
39
|
-
[]
|
40
|
-
[]
|
41
|
-
[]
|
34
|
+
- [] 支持全平台(Platform)、全配置(Configuration)缓存
|
35
|
+
- [] 支持Framework(Dynamic\Static)方式构建
|
36
|
+
- [] 支持local类型
|
37
|
+
- [] 支持swift类型
|
38
|
+
- [] 缓存路径定制
|
39
|
+
- [] 打包脚本定制?
|
40
|
+
- [] Configuration定制?
|
41
|
+
- [] 多Target使用相同Pod但不同subspec相应缓存
|
42
42
|
|
43
43
|
- 命令相关
|
44
|
-
[] 支持'pod update'命令工作
|
45
|
-
[] 支持'pod freeze'命令的查询、缓存操作
|
44
|
+
- [] 支持'pod update'命令工作
|
45
|
+
- [] 支持'pod freeze'命令的查询、缓存操作
|
46
46
|
|
47
47
|
如果你喜欢这个插件,请留下🌟!欢迎提出遇到的问题,以及希望增加的功能!
|
@@ -56,12 +56,6 @@ module Pod
|
|
56
56
|
# freeze!
|
57
57
|
specs_for_freezing.each do |spec|
|
58
58
|
|
59
|
-
# subspec not support;
|
60
|
-
if spec.subspecs.count > 0
|
61
|
-
Pod::UI.puts "`#{spec.name}` can't freeze because it has subspecs!".red
|
62
|
-
next
|
63
|
-
end
|
64
|
-
|
65
59
|
# local not support;
|
66
60
|
if sandbox.local?(spec.name)
|
67
61
|
Pod::UI.puts "`#{spec.name}` can't freeze because it is local!".red
|
@@ -73,93 +67,87 @@ module Pod
|
|
73
67
|
target.root_spec.name == spec.name
|
74
68
|
end || []
|
75
69
|
|
76
|
-
|
77
|
-
|
70
|
+
# todo(ca1md0wn)
|
71
|
+
# Pod has only one target in one platform.
|
72
|
+
# 1. pod has multi target beacause of multi platforms in workspace!
|
73
|
+
# 2. pod has multi target beacause it define in diffenent targets with diffenent subspec!
|
74
|
+
unless pod_targets.count == 1
|
75
|
+
Pod::UI.puts "`#{spec.name}` can't freeze because it has multi targets in workspace!".red
|
78
76
|
next
|
79
77
|
end
|
80
78
|
|
81
|
-
|
82
|
-
pod_targets.each do |target|
|
83
|
-
# todo(ca1md0wn)
|
84
|
-
# should_not_build not support
|
85
|
-
if !target.should_build?
|
86
|
-
Pod::UI.puts "`#{spec.name}` can't freeze because it should not build!".red
|
87
|
-
not_support = true
|
88
|
-
break
|
89
|
-
end
|
79
|
+
pod_target = pod_targets.first
|
90
80
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
break
|
97
|
-
end
|
81
|
+
# target should not build;
|
82
|
+
if !pod_target.should_build?
|
83
|
+
Pod::UI.puts "`#{spec.name}` can't freeze because it should not build!".red
|
84
|
+
next
|
85
|
+
end
|
98
86
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
end
|
87
|
+
# todo(ca1md0wn)
|
88
|
+
# freezer not support swift;
|
89
|
+
if pod_target.uses_swift?
|
90
|
+
Pod::UI.puts "`#{spec.name}` can't freeze because it use swift!".red
|
91
|
+
next
|
92
|
+
end
|
106
93
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
break
|
113
|
-
end
|
94
|
+
# todo(ca1md0wn)
|
95
|
+
# freezer not support to build as framework;
|
96
|
+
if pod_target.requires_frameworks?
|
97
|
+
Pod::UI.puts "`#{spec.name}` don't support to freeze because it will build as framework!".red
|
98
|
+
next
|
114
99
|
end
|
115
|
-
next if not_support
|
116
100
|
|
117
|
-
|
101
|
+
# todo(ca1md0wn)
|
102
|
+
# freezer just support to build at ios; (just support ios now!)
|
103
|
+
if pod_target.platform.name != :ios
|
104
|
+
Pod::UI.puts "`#{spec.name}` don't support to freeze because it is not ios!".red
|
105
|
+
next
|
106
|
+
end
|
118
107
|
|
119
108
|
# setup!
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
next
|
132
|
-
end
|
133
|
-
|
134
|
-
# build iphoneos!
|
135
|
-
iphoneos_paths = Pod::Xcodebuild::build_iphoneos!(installer.sandbox.project_path.realdirpath, target.name, target.product_name)
|
136
|
-
if !iphoneos_paths || iphoneos_paths.count == 0
|
137
|
-
next
|
138
|
-
end
|
139
|
-
|
140
|
-
# lipo!
|
141
|
-
product_path = Pod::Lipo::create!(iphoneos_paths + iphonesimulator_paths, target.product_name)
|
142
|
-
|
143
|
-
when :osx then
|
144
|
-
# todo
|
145
|
-
when :watchos then
|
146
|
-
# todo
|
147
|
-
when :tvos then
|
148
|
-
# todo
|
109
|
+
# pod_target build when
|
110
|
+
# 1.spec change/add 2.product not exist
|
111
|
+
if !unchange_spec_names.include?(spec.name) || !(root + pod_target.product_name).exist?
|
112
|
+
product_path = nil
|
113
|
+
case pod_target.platform.name
|
114
|
+
when :ios then
|
115
|
+
# build iphonesimulator!
|
116
|
+
iphonesimulator_paths = Pod::Xcodebuild::build_iphonesimulator!(installer.sandbox.project_path.realdirpath, pod_target.name, pod_target.product_name)
|
117
|
+
if !iphonesimulator_paths || iphonesimulator_paths.count == 0
|
118
|
+
Pod::UI.puts "`#{spec.name}` don't support to freeze because it build failed!".red
|
119
|
+
next
|
149
120
|
end
|
150
121
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
122
|
+
# build iphoneos!
|
123
|
+
iphoneos_paths = Pod::Xcodebuild::build_iphoneos!(installer.sandbox.project_path.realdirpath, pod_target.name, pod_target.product_name)
|
124
|
+
if !iphoneos_paths || iphoneos_paths.count == 0
|
125
|
+
Pod::UI.puts "`#{spec.name}` don't support to freeze because it build failed!".red
|
126
|
+
next
|
127
|
+
end
|
155
128
|
|
156
|
-
|
157
|
-
|
129
|
+
# lipo!
|
130
|
+
product_path = Pod::Lipo::create!(iphoneos_paths + iphonesimulator_paths, pod_target.product_name)
|
131
|
+
|
132
|
+
when :osx then
|
133
|
+
# todo
|
134
|
+
when :watchos then
|
135
|
+
# todo
|
136
|
+
when :tvos then
|
137
|
+
# todo
|
138
|
+
end
|
158
139
|
|
159
|
-
|
160
|
-
|
140
|
+
if !product_path
|
141
|
+
Pod::UI.puts "`#{spec.name}` don't support to freeze because it build failed!".red
|
142
|
+
next
|
143
|
+
end
|
144
|
+
|
145
|
+
FileUtils.cp_r(product_path, root + pod_target.product_name, :remove_destination => true)
|
161
146
|
end
|
162
147
|
|
148
|
+
frozen_pod = FrozenPod.new(pod_target.pod_name, pod_target.product_name)
|
149
|
+
@frozen_pods += [frozen_pod]
|
150
|
+
|
163
151
|
Pod::UI.puts "`#{spec.name}` freeze!".green
|
164
152
|
end
|
165
153
|
|
@@ -189,54 +177,32 @@ module Pod
|
|
189
177
|
return false
|
190
178
|
end
|
191
179
|
|
192
|
-
def
|
193
|
-
@frozen_pods.
|
194
|
-
frozen_pod.
|
195
|
-
|
196
|
-
|
197
|
-
end
|
180
|
+
def export!(pod_name, path)
|
181
|
+
@frozen_pods.select do |frozen_pod|
|
182
|
+
if frozen_pod.pod_name == pod_name
|
183
|
+
FileUtils.cp_r(root + frozen_pod.product_name, path + frozen_pod.product_name, :remove_destination => true)
|
184
|
+
break;
|
198
185
|
end
|
199
186
|
end
|
200
|
-
|
201
|
-
return false
|
202
|
-
end
|
203
|
-
|
204
|
-
def export!(product_name, path)
|
205
|
-
if !path || !freezed_product?(product_name)
|
206
|
-
return
|
207
|
-
end
|
208
|
-
|
209
|
-
FileUtils.cp_r(root + product_name, path.to_s, :remove_destination => true)
|
210
187
|
end
|
211
188
|
|
212
189
|
private
|
213
190
|
|
214
191
|
class FrozenPod
|
215
|
-
# String
|
192
|
+
# [String]
|
216
193
|
attr_reader :pod_name
|
217
194
|
|
218
|
-
#
|
219
|
-
attr_reader :
|
195
|
+
# [String]
|
196
|
+
attr_reader :product_name
|
220
197
|
|
221
|
-
def initialize(pod_name)
|
198
|
+
def initialize(pod_name, product_name)
|
199
|
+
raise "Params error" unless pod_name.length > 0 && product_name.length > 0
|
222
200
|
@pod_name = pod_name
|
223
|
-
@
|
224
|
-
end
|
225
|
-
|
226
|
-
def mark!(product_name)
|
227
|
-
@product_names += [product_name]
|
228
|
-
end
|
229
|
-
|
230
|
-
def empty?
|
231
|
-
if @product_names.count > 0
|
232
|
-
return false
|
233
|
-
end
|
234
|
-
|
235
|
-
return true
|
201
|
+
@product_name = product_name
|
236
202
|
end
|
237
203
|
end
|
238
204
|
|
239
|
-
# Array<FrozenPod>
|
205
|
+
# [Array<FrozenPod>]
|
240
206
|
@frozen_pods
|
241
207
|
|
242
208
|
def root
|
@@ -20,39 +20,34 @@ module Pod
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def resolve_dependencies_about_freezed
|
23
|
-
major_specs.each do |
|
24
|
-
next unless Pod::Freezer.shared.freezed_pod?(
|
23
|
+
major_specs.each do |major_spec|
|
24
|
+
next unless Pod::Freezer.shared.freezed_pod?(major_spec.name)
|
25
25
|
|
26
26
|
targets = pod_targets.select do |target|
|
27
|
-
target.pod_name ==
|
27
|
+
target.pod_name == major_spec.name
|
28
28
|
end
|
29
29
|
|
30
|
-
|
30
|
+
# Pod has only one target
|
31
|
+
unless targets.count == 1
|
31
32
|
next
|
32
33
|
end
|
33
34
|
|
34
|
-
targets.
|
35
|
+
target = targets.first
|
36
|
+
|
37
|
+
# Pod maybe include multi subspecs,
|
38
|
+
all_specs = analysis_result.specifications.select do |spec|
|
39
|
+
spec.root.name == major_spec.name
|
40
|
+
end.each do |spec|
|
35
41
|
spec.prepare_to_store_freezed(target.platform.name.to_s)
|
36
|
-
|
37
|
-
|
38
|
-
else # not freezed product in platform
|
39
|
-
spec.store_freezed_none(target.platform.name.to_s)
|
40
|
-
end
|
42
|
+
spec.store_freezed(target.platform.name.to_s, target.product_name, target.product_type)
|
43
|
+
spec.done_for_store_freezed
|
41
44
|
end
|
42
|
-
|
43
|
-
spec.done_for_store_freezed
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
47
48
|
def install_source_of_pod_about_freezed(pod_name)
|
48
49
|
if Pod::Freezer.shared.freezed_pod?(pod_name)
|
49
|
-
|
50
|
-
target.pod_name == pod_name
|
51
|
-
end.map do |target|
|
52
|
-
target.product_name
|
53
|
-
end.each do |product_name|
|
54
|
-
Pod::Freezer.shared.export!(product_name, self.sandbox.pod_dir(pod_name) + product_name)
|
55
|
-
end
|
50
|
+
Pod::Freezer.shared.export!(pod_name, self.sandbox.pod_dir(pod_name))
|
56
51
|
end
|
57
52
|
end
|
58
53
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-freezer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ca1md0wn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|