From 83048da5b83b11c928dce514197df4ae1d4e168e Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 28 Sep 2022 08:32:03 -0700 Subject: [PATCH] Move `runtimeexecutor` to be consumed via prefab Summary: This removes the old way of consuming `runtimeexecutor` from `Android-prebuilt.cmake` to using Prefab which is natively supported by the Android pipeline. Changelog: [Internal] [Changed] - Move `runtimeexecutor` to be consumed via prefab Reviewed By: cipolleschi Differential Revision: D39852978 fbshipit-source-id: 87795118f1bcf496a3c50791f920d8b230932555 --- ReactAndroid/build.gradle | 12 ++++++++++-- ReactAndroid/cmake-utils/Android-prebuilt.cmake | 8 -------- .../cmake-utils/ReactNative-application.cmake | 3 ++- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index bdcbc41c00b..aa1a13c6ea7 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -69,7 +69,11 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa new PrefabPreprocessingEntry( "turbomodulejsijni", new Pair("src/main/jni/react/turbomodule", "") - ) + ), + new PrefabPreprocessingEntry( + "runtimeexecutor", + new Pair("../ReactCommon/runtimeexecutor/", "") + ), ] ) it.outputDir.set(prefabHeadersDir) @@ -326,7 +330,8 @@ android { "fabricjni", // prefab targets "react_render_debug", - "turbomodulejsijni" + "turbomodulejsijni", + "runtimeexecutor" } } ndk { @@ -403,6 +408,9 @@ android { turbomodulejsijni { headers(new File(prefabHeadersDir, "turbomodulejsijni").absolutePath) } + runtimeexecutor { + headers(new File(prefabHeadersDir, "runtimeexecutor").absolutePath) + } } publishing { diff --git a/ReactAndroid/cmake-utils/Android-prebuilt.cmake b/ReactAndroid/cmake-utils/Android-prebuilt.cmake index 0a12f99e2e3..39bb1335ec3 100644 --- a/ReactAndroid/cmake-utils/Android-prebuilt.cmake +++ b/ReactAndroid/cmake-utils/Android-prebuilt.cmake @@ -209,13 +209,5 @@ set_target_properties(react_codegen_rncore ${REACT_NDK_EXPORT_DIR}/${ANDROID_ABI}/libreact_codegen_rncore.so) target_include_directories(react_codegen_rncore INTERFACE ${REACT_GENERATED_SRC_DIR}/codegen/jni) -## runtimeexecutor -add_library(runtimeexecutor SHARED IMPORTED GLOBAL) -set_target_properties(runtimeexecutor - PROPERTIES - IMPORTED_LOCATION - ${REACT_NDK_EXPORT_DIR}/${ANDROID_ABI}/libruntimeexecutor.so) -target_include_directories(runtimeexecutor INTERFACE ${REACT_COMMON_DIR}/runtimeexecutor) - ## fbjni add_subdirectory(${FIRST_PARTY_NDK_DIR}/fbjni fbjni_build) diff --git a/ReactAndroid/cmake-utils/ReactNative-application.cmake b/ReactAndroid/cmake-utils/ReactNative-application.cmake index 822ffbb6b62..6149c3e4246 100644 --- a/ReactAndroid/cmake-utils/ReactNative-application.cmake +++ b/ReactAndroid/cmake-utils/ReactNative-application.cmake @@ -43,6 +43,7 @@ target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall -Werror -fexceptions find_package(ReactAndroid REQUIRED CONFIG) add_library(react_render_debug ALIAS ReactAndroid::react_render_debug) add_library(turbomodulejsijni ALIAS ReactAndroid::turbomodulejsijni) +add_library(runtimeexecutor ALIAS ReactAndroid::runtimeexecutor) target_link_libraries(${CMAKE_PROJECT_NAME} fabricjni @@ -60,7 +61,7 @@ target_link_libraries(${CMAKE_PROJECT_NAME} react_render_graphics react_render_mapbuffer rrc_view - runtimeexecutor + runtimeexecutor # prefab ready turbomodulejsijni # prefab ready yoga)