From 86fcab613faff853432745695917136f5caba5e5 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 28 Sep 2022 12:18:18 -0700 Subject: [PATCH] Move `react_debug` to be consumed via prefab Summary: This removes the old way of consuming `react_debug.so` from `Android-prebuilt.cmake` to using Prefab which is natively supported by the Android pipeline. Changelog: [Internal] [Changed] - Move `react_debug` to be consumed via prefab Reviewed By: cipolleschi Differential Revision: D39889945 fbshipit-source-id: e31f3c3027718a54c0a7228db00d145c1f3f7873 --- ReactAndroid/build.gradle | 10 +++++++++- ReactAndroid/cmake-utils/Android-prebuilt.cmake | 9 --------- ReactAndroid/cmake-utils/ReactNative-application.cmake | 3 ++- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index 8c2e435e325..d2fad3bdfcd 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -78,6 +78,10 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa "react_codegen_rncore", new Pair(new File(buildDir, "generated/source/codegen/jni/").absolutePath, "") ), + new PrefabPreprocessingEntry( + "react_debug", + new Pair("../ReactCommon/react/debug/", "react/debug/") + ), ] ) it.outputDir.set(prefabHeadersDir) @@ -336,7 +340,8 @@ android { "react_render_debug", "turbomodulejsijni", "runtimeexecutor", - "react_codegen_rncore" + "react_codegen_rncore", + "react_debug" } } ndk { @@ -419,6 +424,9 @@ android { react_codegen_rncore { headers(new File(prefabHeadersDir, "react_codegen_rncore").absolutePath) } + react_debug { + headers(new File(prefabHeadersDir, "react_debug").absolutePath) + } } publishing { diff --git a/ReactAndroid/cmake-utils/Android-prebuilt.cmake b/ReactAndroid/cmake-utils/Android-prebuilt.cmake index 5a40053762d..6f61d132cc8 100644 --- a/ReactAndroid/cmake-utils/Android-prebuilt.cmake +++ b/ReactAndroid/cmake-utils/Android-prebuilt.cmake @@ -114,15 +114,6 @@ target_include_directories(react_render_core ${REACT_COMMON_DIR} ${REACT_COMMON_DIR}/react/renderer/core) -## react_debug -add_library(react_debug SHARED IMPORTED GLOBAL) -set_target_properties(react_debug - PROPERTIES - IMPORTED_LOCATION - ${REACT_NDK_EXPORT_DIR}/${ANDROID_ABI}/libreact_debug.so) -target_include_directories(react_debug INTERFACE ${REACT_COMMON_DIR}/react/debug) -target_link_libraries(react_nativemodule_core INTERFACE folly_runtime) - ## react_render_graphics add_library(react_render_graphics SHARED IMPORTED GLOBAL) set_target_properties(react_render_graphics diff --git a/ReactAndroid/cmake-utils/ReactNative-application.cmake b/ReactAndroid/cmake-utils/ReactNative-application.cmake index 595a0f99d22..3a01a5b100e 100644 --- a/ReactAndroid/cmake-utils/ReactNative-application.cmake +++ b/ReactAndroid/cmake-utils/ReactNative-application.cmake @@ -45,6 +45,7 @@ add_library(react_render_debug ALIAS ReactAndroid::react_render_debug) add_library(turbomodulejsijni ALIAS ReactAndroid::turbomodulejsijni) add_library(runtimeexecutor ALIAS ReactAndroid::runtimeexecutor) add_library(react_codegen_rncore ALIAS ReactAndroid::react_codegen_rncore) +add_library(react_debug ALIAS ReactAndroid::react_debug) target_link_libraries(${CMAKE_PROJECT_NAME} fabricjni @@ -53,7 +54,7 @@ target_link_libraries(${CMAKE_PROJECT_NAME} glog jsi react_codegen_rncore # prefab ready - react_debug + react_debug # prefab ready react_nativemodule_core react_newarchdefaults react_render_componentregistry