Enable prefab for fbjni integration (#1941)
Summary: I'm in the progress of releasing a prefab-enabled FBJNI release. This dramatically reduces the hackery around integrating with separately released native libraries. This will fail until the release is actually out. Pull Request resolved: https://github.com/facebook/flipper/pull/1941 Test Plan: `./gradlew :sample:installDebug` works as before. Once the release is out, we need to check if this creates any problems with RN but because we advice to exclude the dependency, I expect it not to cause any trouble. Reviewed By: mweststrate Differential Revision: D26545104 Pulled By: passy fbshipit-source-id: 1e21fa1816f28e2fcb52da68863fabc8bc625136
This commit is contained in:
committed by
Facebook GitHub Bot
parent
fa3ff83595
commit
3d2a0e3eb2
@@ -49,18 +49,12 @@ set(libflipper_build_DIR ${build_DIR}/libflipper/${ANDROID_ABI})
|
|||||||
set(libfolly_build_DIR ${build_DIR}/libfolly/${ANDROID_ABI})
|
set(libfolly_build_DIR ${build_DIR}/libfolly/${ANDROID_ABI})
|
||||||
|
|
||||||
file(MAKE_DIRECTORY ${build_DIR})
|
file(MAKE_DIRECTORY ${build_DIR})
|
||||||
file(GLOB libfbjni_link_DIRS "${build_DIR}/fbjni*/jni/${ANDROID_ABI}")
|
find_package(fbjni REQUIRED CONFIG)
|
||||||
file(GLOB libfbjni_include_DIRS "${build_DIR}/fbjni-*-headers.jar/")
|
|
||||||
|
|
||||||
# Without NO_CMAKE_FIND_ROOT_PATH, this will for some bizarre reason only look
|
|
||||||
# in the NDK folder.
|
|
||||||
find_library(FBJNI_LIBRARY fbjni PATHS ${libfbjni_link_DIRS} NO_CMAKE_FIND_ROOT_PATH)
|
|
||||||
|
|
||||||
add_subdirectory(${libflipper_DIR} ${libflipper_build_DIR})
|
add_subdirectory(${libflipper_DIR} ${libflipper_build_DIR})
|
||||||
|
|
||||||
target_include_directories(${PACKAGE_NAME} PRIVATE
|
target_include_directories(${PACKAGE_NAME} PRIVATE
|
||||||
${libjnihack_DIR}
|
${libjnihack_DIR}
|
||||||
${libfbjni_include_DIRS}
|
|
||||||
${libflipper_DIR}
|
${libflipper_DIR}
|
||||||
${libfolly_DIR}
|
${libfolly_DIR}
|
||||||
${glog_DIR}
|
${glog_DIR}
|
||||||
@@ -73,4 +67,4 @@ target_include_directories(${PACKAGE_NAME} PRIVATE
|
|||||||
${LIBEVENT_DIR}/include/event2
|
${LIBEVENT_DIR}/include/event2
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(${PACKAGE_NAME} ${FBJNI_LIBRARY} flippercpp)
|
target_link_libraries(${PACKAGE_NAME} fbjni::fbjni flippercpp)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ android {
|
|||||||
|
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_static'
|
arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_shared'
|
||||||
targets 'flipper', 'event_shared', 'event_extra_shared', 'event_core_shared'
|
targets 'flipper', 'event_shared', 'event_extra_shared', 'event_core_shared'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,6 +51,14 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildFeatures {
|
||||||
|
prefab true
|
||||||
|
}
|
||||||
|
|
||||||
|
packagingOptions {
|
||||||
|
exclude("**/libfbjni.so")
|
||||||
|
exclude("**/libc++_shared.so")
|
||||||
|
}
|
||||||
|
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
@@ -60,10 +68,7 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly deps.proguardAnnotations
|
compileOnly deps.proguardAnnotations
|
||||||
// Temporary until we upgrade to prefabs: https://developer.android.com/studio/releases/gradle-plugin#native-dependencies
|
implementation 'com.facebook.fbjni:fbjni:0.1.0'
|
||||||
implementation 'com.facebook.fbjni:fbjni-java-only:0.0.4'
|
|
||||||
extractHeaders 'com.facebook.fbjni:fbjni:0.0.4:headers'
|
|
||||||
extractJNI 'com.facebook.fbjni:fbjni:0.0.4'
|
|
||||||
implementation deps.soloader
|
implementation deps.soloader
|
||||||
implementation deps.jsr305
|
implementation deps.jsr305
|
||||||
implementation deps.supportAppCompat
|
implementation deps.supportAppCompat
|
||||||
|
|||||||
Reference in New Issue
Block a user