Skip to content

Commit

Permalink
Fix removing Copy Hermes Framework script phase
Browse files Browse the repository at this point in the history
Summary: Changelog: [iOS][Fixed] - Remove `Copy Hermes Framework` script phase for non-Hermes build.

Reviewed By: hramos

Differential Revision: D41051076

fbshipit-source-id: b4b92330934e950ec3156f39f3807b90f803c1ba
  • Loading branch information
dmytrorykun authored and facebook-github-bot committed Nov 7, 2022
1 parent f0b7cbe commit 7f60bcc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/cocoapods/jsengine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def setup_hermes!(react_native_path: "../node_modules/react-native", fabric_enab

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

def remove_copy_hermes_framework_script_phase(installer, react_native_path)
utils_dir = File.join(react_native_path, "sdks", "hermes-engine", "utils")
phase_name = "[RN]Copy Hermes framework"
phase_name = "[RN] Copy Hermes Framework"
project = installer.generated_aggregate_targets.first.user_project
project.targets.first.shell_script_build_phases.delete_if { |phase| phase.name == phase_name }
target = project.native_targets.first
target.shell_script_build_phases.each do |phase|
if phase.name == phase_name
target.build_phases.delete(phase)
end
end
project.save()
end

0 comments on commit 7f60bcc

Please sign in to comment.