@@ -24,7 +24,7 @@ def install_for_prebuild!(standard_sanbox)
24
24
25
25
# make a symlink to target folder
26
26
prebuild_sandbox = Pod ::PrebuildSandbox . from_standard_sandbox ( standard_sanbox )
27
- folder = prebuild_sandbox . framework_folder_path_for_pod_name ( self . name )
27
+ real_file_folder = prebuild_sandbox . framework_folder_path_for_pod_name ( self . name )
28
28
29
29
target_folder = standard_sanbox . pod_dir ( self . name )
30
30
target_folder . rmtree if target_folder . exist?
@@ -39,26 +39,41 @@ def walk(path, &action)
39
39
end
40
40
end
41
41
end
42
- def make_link ( source , basefolder , target_folder )
43
- target = target_folder + source . relative_path_from ( basefolder )
42
+ def make_link ( source , target )
43
+ source = Pathname . new ( source )
44
+ target = Pathname . new ( target )
44
45
target . parent . mkpath unless target . parent . exist?
45
46
relative_source = source . relative_path_from ( target . parent )
46
47
FileUtils . ln_sf ( relative_source , target )
47
48
end
49
+ def mirror_with_symlink ( source , basefolder , target_folder )
50
+ target = target_folder + source . relative_path_from ( basefolder )
51
+ make_link ( source , target )
52
+ end
48
53
49
- walk ( folder ) do |child |
54
+ # symbol link copy all substructure
55
+ walk ( real_file_folder ) do |child |
50
56
source = child
51
57
# only make symlink to file and `.framework` folder
52
58
if child . directory? and child . extname == ".framework"
53
- make_link ( source , folder , target_folder )
59
+ mirror_with_symlink ( source , real_file_folder , target_folder )
54
60
next false # return false means don't go deeper
55
61
elsif child . file?
56
- make_link ( source , folder , target_folder )
62
+ mirror_with_symlink ( source , real_file_folder , target_folder )
57
63
next true
58
64
else
59
65
next true
60
66
end
61
67
end
68
+
69
+ # symbol link copy resource for static framework
70
+ hash = Prebuild ::Passer . resources_to_copy_for_static_framework
71
+ path_objects = hash [ self . name ]
72
+ if path_objects != nil
73
+ path_objects . each do |object |
74
+ make_link ( object . real_file_path , object . target_file_path )
75
+ end
76
+ end
62
77
end
63
78
64
79
end
0 commit comments