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
23 lines
542 B
C++
23 lines
542 B
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the LICENSE
|
|
* file in the root directory of this source tree.
|
|
*/
|
|
#include "yogajni.h"
|
|
#include "YGJNIVanilla.h"
|
|
#include <fbjni/fbjni.h>
|
|
#include "common.h"
|
|
|
|
using namespace facebook::jni;
|
|
using namespace facebook::yoga;
|
|
|
|
jint JNI_OnLoad(JavaVM* vm, void*) {
|
|
jint ret = YGJNI::registerNativeMethods(vm);
|
|
|
|
JNIEnv* env;
|
|
vanillajni::ensureInitialized(&env, vm);
|
|
YGJNIVanilla::registerNatives(env);
|
|
return ret;
|
|
}
|