Skip to content

Commit cfda32c

Browse files
authored
Merge pull request #1580 from firebase/ncooke3-patch-1
[Infra] Embed static frameworks with proper settings
2 parents b3700e8 + cae7b40 commit cfda32c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/add_framework_script.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,14 @@ def add_ref(group, path, source_tree, phase_list)
4242
ref.name = "#{File.basename(path)}"
4343
ref.source_tree = source_tree
4444
phase_list.each do |phase|
45-
phase.add_file_reference(ref)
45+
build_file = phase.add_file_reference(ref)
46+
# In Xcode 15+, the following settings should be applied when embedding
47+
# static frameworks. This will will enable Xcode to strip out the
48+
# framework's static archive and headers, so that only the framework's
49+
# resources remain.
50+
if phase.isa == 'PBXCopyFilesBuildPhase' && phase.name == "Embed Frameworks"
51+
build_file.settings = { 'ATTRIBUTES' => ['CodeSignOnCopy', 'RemoveHeadersOnCopy'] }
52+
end
4653
end
4754
puts ref
4855
end

0 commit comments

Comments
 (0)