Skip to content

Commit

Permalink
Move jsi to be consumed via prefab
Browse files Browse the repository at this point in the history
Summary:
This removes the old way of consuming `libjsi.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `jsi` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39924434

fbshipit-source-id: cb92d3a4ed6cb87e75462082506f310feb7bec9f
  • Loading branch information
cortinico authored and facebook-github-bot committed Sep 29, 2022
1 parent 7c55e6c commit 277a64f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
10 changes: 9 additions & 1 deletion ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa
new PrefabPreprocessingEntry(
"rrc_view",
new Pair("../ReactCommon/react/renderer/components/view/", "react/renderer/components/view/")
),
new PrefabPreprocessingEntry(
"jsi",
new Pair("../ReactCommon/jsi/", "")
)
]
)
Expand Down Expand Up @@ -368,7 +372,8 @@ android {
"react_newarchdefaults",
"react_render_core",
"react_render_graphics",
"rrc_view"
"rrc_view",
"jsi"
}
}
ndk {
Expand Down Expand Up @@ -469,6 +474,9 @@ android {
rrc_view {
headers(new File(prefabHeadersDir, "rrc_view").absolutePath)
}
jsi {
headers(new File(prefabHeadersDir, "jsi").absolutePath)
}
}

publishing {
Expand Down
8 changes: 0 additions & 8 deletions ReactAndroid/cmake-utils/Android-prebuilt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,5 @@ set_target_properties(fabricjni
${REACT_NDK_EXPORT_DIR}/${ANDROID_ABI}/libfabricjni.so)
target_include_directories(fabricjni INTERFACE ${REACT_ANDROID_SRC_DIR}/jni/react/fabric)

## jsi
add_library(jsi SHARED IMPORTED GLOBAL)
set_target_properties(jsi
PROPERTIES
IMPORTED_LOCATION
${REACT_NDK_EXPORT_DIR}/${ANDROID_ABI}/libjsi.so)
target_include_directories(jsi INTERFACE ${REACT_COMMON_DIR}/jsi)

## fbjni
add_subdirectory(${FIRST_PARTY_NDK_DIR}/fbjni fbjni_build)
3 changes: 2 additions & 1 deletion ReactAndroid/cmake-utils/ReactNative-application.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ add_library(react_newarchdefaults ALIAS ReactAndroid::react_newarchdefaults)
add_library(react_render_core ALIAS ReactAndroid::react_render_core)
add_library(react_render_graphics ALIAS ReactAndroid::react_render_graphics)
add_library(rrc_view ALIAS ReactAndroid::rrc_view)
add_library(jsi ALIAS ReactAndroid::jsi)

target_link_libraries(${CMAKE_PROJECT_NAME}
fabricjni
fbjni
folly_runtime
glog
jsi
jsi # prefab ready
react_codegen_rncore # prefab ready
react_debug # prefab ready
react_nativemodule_core
Expand Down

0 comments on commit 277a64f

Please sign in to comment.