Move JNI_OnLoad to separate file which registers both fbjni and jni methods
Summary: Move JNI_ONLoad to a separate file so that both fbjni native methods and vanillla jni native methods can be initialized correctly Reviewed By: amir-shalem Differential Revision: D17840166 fbshipit-source-id: 045df0df7a95bc331cbbefb3a118a349f3029465
This commit is contained in:
committed by
Facebook Github Bot
parent
aa2610c2dd
commit
2e321fc69f
@@ -17,6 +17,7 @@
|
||||
#include "YGJTypes.h"
|
||||
#include "YGJNIVanilla.h"
|
||||
#include "YGJNI.h"
|
||||
#include "yogajni.h"
|
||||
|
||||
using namespace facebook::jni;
|
||||
using namespace std;
|
||||
@@ -616,7 +617,7 @@ void jni_YGNodeStyleSetBorder(jlong nativePointer, jint edge, jfloat border) {
|
||||
#define YGMakeCriticalNativeMethod(name) \
|
||||
makeCriticalNativeMethod_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(#name, name)
|
||||
|
||||
jint JNI_OnLoad(JavaVM* vm, void*) {
|
||||
jint YGJNI::registerNativeMethods(JavaVM* vm) {
|
||||
jint ret = initialize(vm, [] {
|
||||
registerNatives(
|
||||
"com/facebook/yoga/YogaNative",
|
||||
@@ -717,6 +718,5 @@ jint JNI_OnLoad(JavaVM* vm, void*) {
|
||||
jni_YGConfigSetShouldDiffLayoutWithoutLegacyStretchBehaviour),
|
||||
});
|
||||
});
|
||||
YGJNIVanilla::registerNatives(Environment::current());
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user