37
37
project = Xcodeproj ::Project . open ( project_path )
38
38
project_framework_group = project . frameworks_group
39
39
40
- def add_ref ( group , path , source_tree , phase )
40
+ def add_ref ( group , path , source_tree , phase_list )
41
41
ref = group . new_reference ( "#{ path } " )
42
42
ref . name = "#{ File . basename ( path ) } "
43
43
ref . source_tree = source_tree
44
- phase . add_file_reference ( ref )
44
+ phase_list . each do |phase |
45
+ phase . add_file_reference ( ref )
46
+ end
45
47
puts ref
46
48
end
47
49
@@ -53,7 +55,7 @@ def add_ref(group, path, source_tree, phase)
53
55
add_ref ( project . main_group ,
54
56
framework_path ,
55
57
source_tree ,
56
- project_target . resources_build_phase )
58
+ [ project_target . resources_build_phase ] )
57
59
end
58
60
else
59
61
framework_group = Dir . glob ( File . join ( framework_path , "*.{#{ file_ext } }" ) )
@@ -68,7 +70,7 @@ def add_ref(group, path, source_tree, phase)
68
70
add_ref ( project_framework_group ,
69
71
framework ,
70
72
source_tree ,
71
- embed_frameworks_phase )
73
+ [ project_target . frameworks_build_phase , embed_frameworks_phase ] )
72
74
end
73
75
end
74
76
end
@@ -79,7 +81,7 @@ def add_ref(group, path, source_tree, phase)
79
81
add_ref ( project_framework_group ,
80
82
framework_path ,
81
83
source_tree ,
82
- project_target . frameworks_build_phase )
84
+ [ project_target . frameworks_build_phase ] )
83
85
end
84
86
end
85
87
project . save ( )
0 commit comments