Skip to content

Commit 5132652

Browse files
authored
Embed and link
1 parent 9373456 commit 5132652

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/add_framework_script.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@
3737
project = Xcodeproj::Project.open(project_path)
3838
project_framework_group = project.frameworks_group
3939

40-
def add_ref(group, path, source_tree, phase)
40+
def add_ref(group, path, source_tree, phase_list)
4141
ref = group.new_reference("#{path}")
4242
ref.name = "#{File.basename(path)}"
4343
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
4547
puts ref
4648
end
4749

@@ -53,7 +55,7 @@ def add_ref(group, path, source_tree, phase)
5355
add_ref(project.main_group,
5456
framework_path,
5557
source_tree,
56-
project_target.resources_build_phase)
58+
[project_target.resources_build_phase])
5759
end
5860
else
5961
framework_group = Dir.glob(File.join(framework_path, "*.{#{file_ext}}"))
@@ -68,7 +70,7 @@ def add_ref(group, path, source_tree, phase)
6870
add_ref(project_framework_group,
6971
framework,
7072
source_tree,
71-
embed_frameworks_phase)
73+
[project_target.frameworks_build_phase, embed_frameworks_phase])
7274
end
7375
end
7476
end
@@ -79,7 +81,7 @@ def add_ref(group, path, source_tree, phase)
7981
add_ref(project_framework_group,
8082
framework_path,
8183
source_tree,
82-
project_target.frameworks_build_phase)
84+
[project_target.frameworks_build_phase])
8385
end
8486
end
8587
project.save()

0 commit comments

Comments
 (0)