13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
# File 'lib/cocoapods-binary-cache/pod-binary/integration/source_installer.rb', line 13
def install_for_prebuild!(standard_sanbox)
return if !PodPrebuild.config.dev_pods_enabled? && standard_sanbox.local?(name)
prebuild_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(standard_sanbox)
target_names = prebuild_sandbox.existed_target_names_for_pod_name(name)
target_names.each do |name|
real_file_folder = prebuild_sandbox.framework_folder_path_for_target_name(name)
target_folder = standard_sanbox.pod_dir(self.name)
target_folder += real_file_folder.basename if target_names.count > 1
target_folder += PodPrebuild.config.prebuilt_path
target_folder.rmtree if target_folder.exist?
target_folder.mkpath
walk(real_file_folder) do |child|
source = child
if child.directory? && [".framework", ".dSYM"].include?(child.extname)
mirror_with_symlink(source, real_file_folder, target_folder) if child.extname == ".framework"
next false
elsif child.file?
mirror_with_symlink(source, real_file_folder, target_folder)
next true
else
next true
end
end
metadata = PodPrebuild::Metadata.in_dir(real_file_folder)
next unless metadata.static_framework?
metadata.resources.each do |path|
target_file_path = path
.sub("${PODS_ROOT}", sandbox.root.to_path)
.sub("${PODS_CONFIGURATION_BUILD_DIR}", sandbox.root.to_path)
real_file_path = real_file_folder + metadata.framework_name + File.basename(path)
case File.extname(path)
when ".xib"
real_file_path = real_file_path.sub_ext(".nib")
target_file_path = target_file_path.sub(".xib", ".nib")
when ".bundle"
next if metadata.resource_bundles.include?(File.basename(path))
real_file_path = real_file_folder + File.basename(path) unless real_file_path.exist?
end
make_link(real_file_path, target_file_path)
end
end
end
|