From c91688eebad98d86e1d696de9a6ed3cbf7350bf6 Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Mon, 11 Sep 2023 05:53:45 -0700 Subject: [PATCH] Copy new Hermes CDP headers for iOS build (#39365) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39365 The new Hermes CDP introduces new directories & headers. These need to be copied just like the other headers that Hermes API provides. Changelog: [Internal] Reviewed By: dmytrorykun Differential Revision: D49067283 fbshipit-source-id: 0cf11470e123bf63c645466cb066f68b50bcac4a --- .../sdks/hermes-engine/hermes-engine.podspec | 12 +++++++++ .../utils/build-apple-framework.sh | 26 ++++++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec index b0023d0cc11..227be7560c6 100644 --- a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec +++ b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec @@ -73,6 +73,18 @@ Pod::Spec.new do |spec| ss.header_dir = 'hermes' end + spec.subspec 'inspector' do |ss| + ss.source_files = '' + ss.public_header_files = 'API/hermes/inspector/*.h' + ss.header_dir = 'hermes/inspector' + end + + spec.subspec 'inspector_chrome' do |ss| + ss.source_files = '' + ss.public_header_files = 'API/hermes/inspector/chrome/*.h' + ss.header_dir = 'hermes/inspector/chrome' + end + spec.subspec 'Public' do |ss| ss.source_files = '' ss.public_header_files = 'public/hermes/Public/*.h' diff --git a/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh b/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh index ec7bb17abaf..cb7b6d70e61 100755 --- a/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh +++ b/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh @@ -121,9 +121,19 @@ function build_apple_framework { fi # Copy over Hermes and JSI API headers. - mkdir -p destroot/include/hermes/Public destroot/include/jsi + mkdir -p destroot/include/hermes/Public cp public/hermes/Public/*.h destroot/include/hermes/Public + + mkdir -p destroot/include/hermes cp API/hermes/*.h destroot/include/hermes + + mkdir -p destroot/include/hermes/inspector + cp API/hermes/inspector/*.h destroot/include/hermes/inspector + + mkdir -p destroot/include/hermes/inspector/chrome + cp API/hermes/inspector/chrome/*.h destroot/include/hermes/inspector/chrome + + mkdir -p destroot/include/jsi cp "$JSI_PATH"/jsi/*.h destroot/include/jsi popd > /dev/null || exit 1 } @@ -137,10 +147,20 @@ function prepare_dest_root_for_ci { cp -R "./build_catalyst/API/hermes/hermes.framework"* "destroot/Library/Frameworks/catalyst" cp "./build_macosx/bin/"* "destroot/bin" - mkdir -p destroot/include/hermes/Public destroot/include/jsi - + # Copy over Hermes and JSI API headers. + mkdir -p destroot/include/hermes/Public cp public/hermes/Public/*.h destroot/include/hermes/Public + + mkdir -p destroot/include/hermes cp API/hermes/*.h destroot/include/hermes + + mkdir -p destroot/include/hermes/inspector + cp API/hermes/inspector/*.h destroot/include/hermes/inspector + + mkdir -p destroot/include/hermes/inspector/chrome + cp API/hermes/inspector/chrome/*.h destroot/include/hermes/inspector/chrome + + mkdir -p destroot/include/jsi cp "$JSI_PATH"/jsi/*.h destroot/include/jsi }