From 4bcb0ab762d56d2f99012ff5df95110f6d796405 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 28 Sep 2022 08:32:03 -0700 Subject: [PATCH] Move `turbomodulejsijni` to be consumed via prefab Summary: This removes the old way of consuming `turbomodulejsijni.so` from `Android-prebuilt.cmake` to using Prefab which is natively supported by the Android pipeline. Changelog: [Internal] [Changed] - Move `turbomodulejsijni` to be consumed via prefab Reviewed By: cipolleschi Differential Revision: D39851647 fbshipit-source-id: 6201546ad47a53b366a54b022457fce7b744f064 --- ReactAndroid/build.gradle | 11 +++++++++-- ReactAndroid/cmake-utils/Android-prebuilt.cmake | 10 ---------- .../cmake-utils/ReactNative-application.cmake | 3 ++- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index 044d737a83d..bdcbc41c00b 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -65,6 +65,10 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa new PrefabPreprocessingEntry( "react_render_debug", new Pair("../ReactCommon/react/renderer/debug/", "react/renderer/debug/") + ), + new PrefabPreprocessingEntry( + "turbomodulejsijni", + new Pair("src/main/jni/react/turbomodule", "") ) ] ) @@ -319,10 +323,10 @@ android { "reactnativeblob", "reactperfloggerjni", "react_newarchdefaults", - "turbomodulejsijni", "fabricjni", // prefab targets - "react_render_debug" + "react_render_debug", + "turbomodulejsijni" } } ndk { @@ -396,6 +400,9 @@ android { react_render_debug { headers(new File(prefabHeadersDir, "react_render_debug").absolutePath) } + turbomodulejsijni { + headers(new File(prefabHeadersDir, "turbomodulejsijni").absolutePath) + } } publishing { diff --git a/ReactAndroid/cmake-utils/Android-prebuilt.cmake b/ReactAndroid/cmake-utils/Android-prebuilt.cmake index e5345ba9f11..0a12f99e2e3 100644 --- a/ReactAndroid/cmake-utils/Android-prebuilt.cmake +++ b/ReactAndroid/cmake-utils/Android-prebuilt.cmake @@ -103,16 +103,6 @@ target_include_directories(react_nativemodule_core ${REACT_COMMON_DIR}/react/nativemodule/core/platform/android) target_link_libraries(react_nativemodule_core INTERFACE folly_runtime) -## turbomodulejsijni -add_library(turbomodulejsijni SHARED IMPORTED GLOBAL) -set_target_properties(turbomodulejsijni - PROPERTIES - IMPORTED_LOCATION - ${REACT_NDK_EXPORT_DIR}/${ANDROID_ABI}/libturbomodulejsijni.so) -target_include_directories(turbomodulejsijni - INTERFACE - ${REACT_ANDROID_SRC_DIR}/jni/react/turbomodule) - ## react_render_core add_library(react_render_core SHARED IMPORTED GLOBAL) set_target_properties(react_render_core diff --git a/ReactAndroid/cmake-utils/ReactNative-application.cmake b/ReactAndroid/cmake-utils/ReactNative-application.cmake index 01dc432fd39..822ffbb6b62 100644 --- a/ReactAndroid/cmake-utils/ReactNative-application.cmake +++ b/ReactAndroid/cmake-utils/ReactNative-application.cmake @@ -42,6 +42,7 @@ target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall -Werror -fexceptions # Prefab packages find_package(ReactAndroid REQUIRED CONFIG) add_library(react_render_debug ALIAS ReactAndroid::react_render_debug) +add_library(turbomodulejsijni ALIAS ReactAndroid::turbomodulejsijni) target_link_libraries(${CMAKE_PROJECT_NAME} fabricjni @@ -60,7 +61,7 @@ target_link_libraries(${CMAKE_PROJECT_NAME} react_render_mapbuffer rrc_view runtimeexecutor - turbomodulejsijni + turbomodulejsijni # prefab ready yoga) # If project is on RN CLI v9, then we can use the following lines to link against the autolinked 3rd party libraries.