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
This commit is contained in:
Nicola Corti
2022-09-28 08:32:03 -07:00
committed by Facebook GitHub Bot
parent 85f3e2416f
commit 4bcb0ab762
3 changed files with 11 additions and 13 deletions
+9 -2
View File
@@ -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 {
@@ -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
@@ -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.