Skip to content

Commit 0dd6c98

Browse files
authored
[Infra] Embed static frameworks with proper settings
1 parent b3700e8 commit 0dd6c98

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scripts/add_framework_script.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,16 @@ 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+
puts phase
46+
build_file = phase.add_file_reference(ref)
47+
# In Xcode 15+, the following settings should be applied when embedded
48+
# static frameworks. This will will enable Xcode to strip out the
49+
# framework's static archive and headers, so that only the framework's
50+
# resources remain.
51+
if phase.isa == 'PBXCopyFilesBuildPhase' && phase.name == "Embed Frameworks"
52+
build_file.settings = { 'ATTRIBUTES' => ['CodeSignOnCopy', 'RemoveHeadersOnCopy'] }
53+
puts build_file
54+
end
4655
end
4756
puts ref
4857
end

0 commit comments

Comments
 (0)