Skip to content

Commit

Permalink
Embed and link
Browse files Browse the repository at this point in the history
  • Loading branch information
ncooke3 authored Apr 26, 2024
1 parent 9373456 commit 5132652
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/add_framework_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@
project = Xcodeproj::Project.open(project_path)
project_framework_group = project.frameworks_group

def add_ref(group, path, source_tree, phase)
def add_ref(group, path, source_tree, phase_list)
ref = group.new_reference("#{path}")
ref.name = "#{File.basename(path)}"
ref.source_tree = source_tree
phase.add_file_reference(ref)
phase_list.each do |phase|
phase.add_file_reference(ref)
end
puts ref
end

Expand All @@ -53,7 +55,7 @@ def add_ref(group, path, source_tree, phase)
add_ref(project.main_group,
framework_path,
source_tree,
project_target.resources_build_phase)
[project_target.resources_build_phase])
end
else
framework_group = Dir.glob(File.join(framework_path, "*.{#{file_ext}}"))
Expand All @@ -68,7 +70,7 @@ def add_ref(group, path, source_tree, phase)
add_ref(project_framework_group,
framework,
source_tree,
embed_frameworks_phase)
[project_target.frameworks_build_phase, embed_frameworks_phase])
end
end
end
Expand All @@ -79,7 +81,7 @@ def add_ref(group, path, source_tree, phase)
add_ref(project_framework_group,
framework_path,
source_tree,
project_target.frameworks_build_phase)
[project_target.frameworks_build_phase])
end
end
project.save()

0 comments on commit 5132652

Please sign in to comment.