From 0dd6c98a4d9c4bfe4834f243ad226b5211326575 Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:14:01 -0400 Subject: [PATCH] [Infra] Embed static frameworks with proper settings --- scripts/add_framework_script.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/add_framework_script.rb b/scripts/add_framework_script.rb index 80286d4a3..a7d80b703 100755 --- a/scripts/add_framework_script.rb +++ b/scripts/add_framework_script.rb @@ -42,7 +42,16 @@ def add_ref(group, path, source_tree, phase_list) ref.name = "#{File.basename(path)}" ref.source_tree = source_tree phase_list.each do |phase| - phase.add_file_reference(ref) + puts phase + build_file = phase.add_file_reference(ref) + # In Xcode 15+, the following settings should be applied when embedded + # static frameworks. This will will enable Xcode to strip out the + # framework's static archive and headers, so that only the framework's + # resources remain. + if phase.isa == 'PBXCopyFilesBuildPhase' && phase.name == "Embed Frameworks" + build_file.settings = { 'ATTRIBUTES' => ['CodeSignOnCopy', 'RemoveHeadersOnCopy'] } + puts build_file + end end puts ref end