cocoapods-binaryhqp 0.5.2 → 0.5.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 565caa20391d4ee0ad9cd3620069122545da6ad40faaf74907d1d2d3284cf2bf
|
4
|
+
data.tar.gz: bea179595b39bca57caee759a3de746fdfc4da037881f9cca9f8e08eb776a8f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5313617b1242d2e669e8cc11f8dc8dce6706f2736a01b676fbefec2d54b0ff2f41304819c3e33ef0941c4c7f600b37c424ce723fe16071eeebd9c657c97c826
|
7
|
+
data.tar.gz: a4b55835877d6b415b68ce5178c449846093ee40384351cb68f139bd6a7ffadba0e7e2175340ece7c9b00c7569287de4f5386cd5b79f904c75872fb37ec7a567
|
data/.vscode/launch.json
CHANGED
@@ -8,10 +8,10 @@
|
|
8
8
|
"useBundler": true,
|
9
9
|
"cwd": "${workspaceRoot}/demo", // pod 命令执行的路径
|
10
10
|
"program": "/usr/local/bin/pod",
|
11
|
-
// "args": ["update",
|
12
|
-
|
11
|
+
// "args": ["update", "--verbose"]// `pod` 命令的参数
|
12
|
+
"args": ["install", "--verbose"]
|
13
13
|
// "args": ["install","--hsource", "--verbose"]
|
14
|
-
"args":["install", "--help"]
|
14
|
+
// "args":["install", "--help"]
|
15
15
|
}
|
16
16
|
]
|
17
17
|
}
|
@@ -146,6 +146,11 @@ module Pod
|
|
146
146
|
self.sandbox.exsited_framework_target_names.each do |name|
|
147
147
|
UI.puts "Using #{name}" if config.verbose
|
148
148
|
end
|
149
|
+
|
150
|
+
self.resolve_dependencies
|
151
|
+
#处理资源文件
|
152
|
+
self.handle_static_framework_resouces
|
153
|
+
|
149
154
|
end
|
150
155
|
|
151
156
|
def delete_standard_sand_box_pod(standard_sanbox)
|
@@ -173,6 +178,43 @@ module Pod
|
|
173
178
|
end
|
174
179
|
end
|
175
180
|
end
|
181
|
+
# 处理静态库资源
|
182
|
+
def handle_static_framework_resouces
|
183
|
+
all_static_framework_targets = pod_targets.reject{|pod_target| not pod_target.static_framework? or pod_target.resource_paths.empty? }
|
184
|
+
all_static_framework_targets.each do |target|
|
185
|
+
output_path = sandbox.framework_folder_path_for_target_name(target.name)
|
186
|
+
if target.static_framework? and !target.resource_paths.empty?
|
187
|
+
framework_path = output_path + target.framework_name
|
188
|
+
standard_sandbox_path = sandbox.standard_sanbox_path
|
189
|
+
resources = begin
|
190
|
+
if Pod::VERSION.start_with? "1.5"
|
191
|
+
target.resource_paths
|
192
|
+
else
|
193
|
+
# resource_paths is Hash{String=>Array<String>} on 1.6 and above
|
194
|
+
# (use AFNetworking to generate a demo data)
|
195
|
+
# https://github.com/leavez/cocoapods-binary/issues/50
|
196
|
+
target.resource_paths.values.flatten
|
197
|
+
end
|
198
|
+
end
|
199
|
+
raise "Wrong type: #{resources}" unless resources.kind_of? Array
|
200
|
+
|
201
|
+
path_objects = resources.map do |path|
|
202
|
+
prebuild_real_path = (path.gsub('${PODS_ROOT}', sandbox.root.to_s) if path.start_with? '${PODS_ROOT}')|| ""
|
203
|
+
real_file_path = framework_path + File.basename(path)
|
204
|
+
if Pathname.new(prebuild_real_path).exist? and not Pathname.new(real_file_path).exist?
|
205
|
+
# 静态库的resource,拷贝至framework目录下
|
206
|
+
FileUtils.cp_r(prebuild_real_path, real_file_path, :remove_destination => true)
|
207
|
+
end
|
208
|
+
object = Prebuild::Passer::ResourcePath.new
|
209
|
+
object.real_file_path = real_file_path
|
210
|
+
object.target_file_path = path.gsub('${PODS_ROOT}', standard_sandbox_path.to_s) if path.start_with? '${PODS_ROOT}'
|
211
|
+
object.target_file_path = path.gsub("${PODS_CONFIGURATION_BUILD_DIR}", standard_sandbox_path.to_s) if path.start_with? "${PODS_CONFIGURATION_BUILD_DIR}"
|
212
|
+
object
|
213
|
+
end
|
214
|
+
Prebuild::Passer.resources_to_copy_for_static_framework[target.name] = path_objects
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
176
218
|
|
177
219
|
|
178
220
|
# Build the needed framework files
|
@@ -226,7 +268,6 @@ module Pod
|
|
226
268
|
|
227
269
|
targets = targets.reject {|pod_target| sandbox.local?(pod_target.pod_name) }
|
228
270
|
|
229
|
-
|
230
271
|
# build!
|
231
272
|
Pod::UI.puts "Prebuild frameworks (total #{targets.count})"
|
232
273
|
Pod::Prebuild.remove_build_dir(sandbox_path)
|
@@ -240,44 +281,13 @@ module Pod
|
|
240
281
|
output_path.rmtree if output_path.exist?
|
241
282
|
output_path.mkpath unless output_path.exist?
|
242
283
|
Pod::Prebuild.build(sandbox_path, target, output_path, bitcode_enabled, Podfile::DSL.custom_build_options, Podfile::DSL.custom_build_options_simulator)
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
framework_path = output_path + target.framework_name
|
247
|
-
standard_sandbox_path = sandbox.standard_sanbox_path
|
248
|
-
|
249
|
-
resources = begin
|
250
|
-
if Pod::VERSION.start_with? "1.5"
|
251
|
-
target.resource_paths
|
252
|
-
else
|
253
|
-
# resource_paths is Hash{String=>Array<String>} on 1.6 and above
|
254
|
-
# (use AFNetworking to generate a demo data)
|
255
|
-
# https://github.com/leavez/cocoapods-binary/issues/50
|
256
|
-
target.resource_paths.values.flatten
|
257
|
-
end
|
258
|
-
end
|
259
|
-
raise "Wrong type: #{resources}" unless resources.kind_of? Array
|
260
|
-
# resource : ${PODS_ROOT}
|
261
|
-
# resource_bundles : ${PODS_CONFIGURATION_BUILD_DIR},不做处理
|
262
|
-
path_objects = resources.map do |path|
|
263
|
-
prebuild_real_path = (path.gsub('${PODS_ROOT}', sandbox.root.to_s) if path.start_with? '${PODS_ROOT}')|| ""
|
264
|
-
real_file_path = framework_path + File.basename(path)
|
265
|
-
if Pathname.new(prebuild_real_path).exist?
|
266
|
-
# 静态库的resource,拷贝至framework目录下
|
267
|
-
FileUtils.cp_r(prebuild_real_path, real_file_path, :remove_destination => true)
|
268
|
-
end
|
269
|
-
object = Prebuild::Passer::ResourcePath.new
|
270
|
-
object.real_file_path = real_file_path
|
271
|
-
object.target_file_path = path.gsub('${PODS_ROOT}', standard_sandbox_path.to_s) if path.start_with? '${PODS_ROOT}'
|
272
|
-
object.target_file_path = path.gsub("${PODS_CONFIGURATION_BUILD_DIR}", standard_sandbox_path.to_s) if path.start_with? "${PODS_CONFIGURATION_BUILD_DIR}"
|
273
|
-
object
|
274
|
-
end
|
275
|
-
Prebuild::Passer.resources_to_copy_for_static_framework[target.name] = path_objects
|
276
|
-
end
|
277
|
-
|
278
|
-
end
|
284
|
+
end
|
285
|
+
# check static_framework resources
|
286
|
+
self.handle_static_framework_resouces
|
279
287
|
Pod::Prebuild.remove_build_dir(sandbox_path)
|
280
288
|
|
289
|
+
|
290
|
+
|
281
291
|
|
282
292
|
# copy vendored libraries and frameworks
|
283
293
|
targets.each do |target|
|
@@ -2,27 +2,50 @@ module Pod
|
|
2
2
|
class Command
|
3
3
|
class Install < Command
|
4
4
|
@@use_source = false
|
5
|
+
|
6
|
+
class << self
|
7
|
+
alias :original_options :options
|
8
|
+
end
|
5
9
|
def self.options
|
6
|
-
[
|
7
|
-
['--hsource', 'from cocoapods-binaryhqp, all frameworks use source code'],
|
8
|
-
].concat(super).reject { |(name, _)| name == '--no-repo-update' }
|
10
|
+
[['--hsource', 'from cocoapods-binaryhqp, all frameworks use source code']].concat(original_options)
|
9
11
|
end
|
10
12
|
|
13
|
+
alias :original_initialize :initialize
|
11
14
|
def initialize(argv)
|
12
|
-
super
|
13
15
|
@@use_source = argv.flag?('hsource', false)
|
16
|
+
original_initialize(argv)
|
14
17
|
end
|
15
18
|
|
16
19
|
def self.all_use_source
|
17
20
|
@@use_source
|
18
21
|
end
|
19
22
|
|
20
|
-
def self.
|
21
|
-
|
23
|
+
def self.set_all_use_source(use)
|
24
|
+
@@use_source = use
|
22
25
|
end
|
23
26
|
|
24
27
|
|
25
28
|
end
|
26
29
|
end
|
27
30
|
end
|
31
|
+
|
32
|
+
module Pod
|
33
|
+
class Command
|
34
|
+
class Update < Command
|
35
|
+
class << self
|
36
|
+
alias :original_options :options
|
37
|
+
end
|
38
|
+
def self.options
|
39
|
+
[['--hsource', 'from cocoapods-binaryhqp, all frameworks use source code']].concat(original_options)
|
40
|
+
end
|
41
|
+
|
42
|
+
alias :original_initialize :initialize
|
43
|
+
def initialize(argv)
|
44
|
+
use = argv.flag?('hsource', false)
|
45
|
+
Pod::Command::Install.set_all_use_source(use)
|
46
|
+
original_initialize(argv)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
28
51
|
|