Skip to content

Commit 7f60bcc

Browse files
dmytrorykunfacebook-github-bot
authored andcommitted
Fix removing Copy Hermes Framework script phase
Summary: Changelog: [iOS][Fixed] - Remove `Copy Hermes Framework` script phase for non-Hermes build. Reviewed By: hramos Differential Revision: D41051076 fbshipit-source-id: b4b92330934e950ec3156f39f3807b90f803c1ba
1 parent f0b7cbe commit 7f60bcc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

scripts/cocoapods/jsengine.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def setup_hermes!(react_native_path: "../node_modules/react-native", fabric_enab
3737

3838
def add_copy_hermes_framework_script_phase(installer, react_native_path)
3939
utils_dir = File.join(react_native_path, "sdks", "hermes-engine", "utils")
40-
phase_name = "[RN]Copy Hermes framework"
40+
phase_name = "[RN] Copy Hermes Framework"
4141
project = installer.generated_aggregate_targets.first.user_project
4242
target = project.targets.first
4343
if target.shell_script_build_phases.none? { |phase| phase.name == phase_name }
@@ -49,8 +49,13 @@ def add_copy_hermes_framework_script_phase(installer, react_native_path)
4949

5050
def remove_copy_hermes_framework_script_phase(installer, react_native_path)
5151
utils_dir = File.join(react_native_path, "sdks", "hermes-engine", "utils")
52-
phase_name = "[RN]Copy Hermes framework"
52+
phase_name = "[RN] Copy Hermes Framework"
5353
project = installer.generated_aggregate_targets.first.user_project
54-
project.targets.first.shell_script_build_phases.delete_if { |phase| phase.name == phase_name }
54+
target = project.native_targets.first
55+
target.shell_script_build_phases.each do |phase|
56+
if phase.name == phase_name
57+
target.build_phases.delete(phase)
58+
end
59+
end
5560
project.save()
5661
end

0 commit comments

Comments
 (0)