From bf27fdd9550d0fe96cdee9eab9ea75b0887809c7 Mon Sep 17 00:00:00 2001 From: wdzhangchukong <38641173+wdzhangchukong@users.noreply.github.com> Date: Fri, 24 Aug 2018 17:03:50 +0800 Subject: [PATCH] Rename cc in JSB (#1476) * Rename __ccgl to __gl * Rename __CCPrivateData to __PrivateData * Change CanvasRenderingContext2D to global * Change CanvasRenderingContext2D to global * Change getDeviceMotionValue into Device * Change FileUtils to global * Change AudioEngine to global * Change AudioEngine into Audio * Remove cc in c++ * Remove __jsc__ * Change auto file template * Name jsb_cocos2d_global to auto * Reset jsb_cocos2dx_auto * Register jsb_cocos2dx_global_auto --- native/cocos/Android.mk | 1 + .../jswrapper/chakracore/ScriptEngine.cpp | 2 +- .../js-bindings/jswrapper/jsc/ScriptEngine.mm | 2 +- .../js-bindings/jswrapper/sm/ScriptEngine.cpp | 2 +- .../js-bindings/jswrapper/v8/Object.cpp | 2 +- .../js-bindings/jswrapper/v8/ScriptEngine.cpp | 2 +- .../manual/jsb_cocos2dx_manual.cpp | 63 ++++++++++++++++- .../js-bindings/manual/jsb_global.cpp | 47 +------------ .../scripting/js-bindings/manual/jsb_global.h | 1 - .../manual/jsb_module_register.cpp | 2 + .../scripting/js-bindings/manual/jsb_node.cpp | 8 ++- native/tools/tojs/cocos2dx.ini | 16 ++--- native/tools/tojs/cocos2dx_global.ini | 70 +++++++++++++++++++ native/tools/tojs/genbindings.py | 1 + 14 files changed, 157 insertions(+), 62 deletions(-) create mode 100644 native/tools/tojs/cocos2dx_global.ini diff --git a/native/cocos/Android.mk b/native/cocos/Android.mk index 4a014f14af..d0a17e2294 100644 --- a/native/cocos/Android.mk +++ b/native/cocos/Android.mk @@ -80,6 +80,7 @@ scripting/js-bindings/auto/jsb_gfx_auto.cpp \ scripting/js-bindings/auto/jsb_cocos2dx_network_auto.cpp \ scripting/js-bindings/auto/jsb_renderer_auto.cpp \ scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp \ +scripting/js-bindings/auto/jsb_cocos2dx_global_auto.cpp \ scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp \ scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp \ scripting/js-bindings/manual/JavaScriptJavaBridge.cpp \ diff --git a/native/cocos/scripting/js-bindings/jswrapper/chakracore/ScriptEngine.cpp b/native/cocos/scripting/js-bindings/jswrapper/chakracore/ScriptEngine.cpp index 3bb3fa28d5..78cd3da5b3 100644 --- a/native/cocos/scripting/js-bindings/jswrapper/chakracore/ScriptEngine.cpp +++ b/native/cocos/scripting/js-bindings/jswrapper/chakracore/ScriptEngine.cpp @@ -242,7 +242,7 @@ namespace se { _globalObj->defineFunction("log", __log); _globalObj->defineFunction("forceGC", __forceGC); - __jsb_CCPrivateData_class = Class::create("__CCPrivateData", _globalObj, nullptr, privateDataContructor); + __jsb_CCPrivateData_class = Class::create("__PrivateData", _globalObj, nullptr, privateDataContructor); __jsb_CCPrivateData_class->defineFinalizeFunction(privateDataFinalize); __jsb_CCPrivateData_class->install(); diff --git a/native/cocos/scripting/js-bindings/jswrapper/jsc/ScriptEngine.mm b/native/cocos/scripting/js-bindings/jswrapper/jsc/ScriptEngine.mm index da98f3f23c..aa56ac0f1b 100644 --- a/native/cocos/scripting/js-bindings/jswrapper/jsc/ScriptEngine.mm +++ b/native/cocos/scripting/js-bindings/jswrapper/jsc/ScriptEngine.mm @@ -292,7 +292,7 @@ namespace se { JSObjectSetProperty(_cx, globalObj, propertyName, JSObjectMakeFunctionWithCallback(_cx, propertyName, __forceGC), kJSPropertyAttributeReadOnly, nullptr); JSStringRelease(propertyName); - __jsb_CCPrivateData_class = Class::create("__CCPrivateData", _globalObj, nullptr, privateDataContructor); + __jsb_CCPrivateData_class = Class::create("__PrivateData", _globalObj, nullptr, privateDataContructor); __jsb_CCPrivateData_class->defineFinalizeFunction(privateDataFinalize); __jsb_CCPrivateData_class->install(); diff --git a/native/cocos/scripting/js-bindings/jswrapper/sm/ScriptEngine.cpp b/native/cocos/scripting/js-bindings/jswrapper/sm/ScriptEngine.cpp index c4706ef8c0..740a69ab23 100644 --- a/native/cocos/scripting/js-bindings/jswrapper/sm/ScriptEngine.cpp +++ b/native/cocos/scripting/js-bindings/jswrapper/sm/ScriptEngine.cpp @@ -524,7 +524,7 @@ namespace se { JS::SetEnqueuePromiseJobCallback(_cx, onEnqueuePromiseJobCallback); JS::SetGetIncumbentGlobalCallback(_cx, onGetIncumbentGlobalCallback); - __jsb_CCPrivateData_class = Class::create("__CCPrivateData", _globalObj, nullptr, privateDataContructor); + __jsb_CCPrivateData_class = Class::create("__PrivateData", _globalObj, nullptr, privateDataContructor); __jsb_CCPrivateData_class->defineFinalizeFunction(privateDataFinalize); __jsb_CCPrivateData_class->install(); diff --git a/native/cocos/scripting/js-bindings/jswrapper/v8/Object.cpp b/native/cocos/scripting/js-bindings/jswrapper/v8/Object.cpp index bee32c14ea..396bd4193f 100644 --- a/native/cocos/scripting/js-bindings/jswrapper/v8/Object.cpp +++ b/native/cocos/scripting/js-bindings/jswrapper/v8/Object.cpp @@ -143,7 +143,7 @@ namespace se { obj->_obj.persistent().Reset(); obj->_rootCount = 0; - if (cls != nullptr && cls->_name == "__CCPrivateData") + if (cls != nullptr && cls->_name == "__PrivateData") { toReleaseObjects.push_back(obj); } diff --git a/native/cocos/scripting/js-bindings/jswrapper/v8/ScriptEngine.cpp b/native/cocos/scripting/js-bindings/jswrapper/v8/ScriptEngine.cpp index b9eb247e9d..8b84e78578 100644 --- a/native/cocos/scripting/js-bindings/jswrapper/v8/ScriptEngine.cpp +++ b/native/cocos/scripting/js-bindings/jswrapper/v8/ScriptEngine.cpp @@ -428,7 +428,7 @@ namespace se { _globalObj->defineFunction("log", __log); _globalObj->defineFunction("forceGC", __forceGC); - __jsb_CCPrivateData_class = Class::create("__CCPrivateData", _globalObj, nullptr, nullptr); + __jsb_CCPrivateData_class = Class::create("__PrivateData", _globalObj, nullptr, nullptr); __jsb_CCPrivateData_class->defineFinalizeFunction(privateDataFinalize); __jsb_CCPrivateData_class->setCreateProto(false); __jsb_CCPrivateData_class->install(); diff --git a/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_manual.cpp b/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_manual.cpp index 78d70fae89..bbf51f7c35 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_manual.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_manual.cpp @@ -29,6 +29,7 @@ #include "cocos/scripting/js-bindings/manual/jsb_conversions.hpp" #include "cocos/scripting/js-bindings/manual/jsb_global.h" #include "cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp" +#include "cocos/scripting/js-bindings/auto/jsb_cocos2dx_global_auto.hpp" #include "storage/local-storage/LocalStorage.h" #include "cocos2d.h" @@ -202,7 +203,15 @@ void __JSPlistDelegator::textHandler(void*, const char *ch, int len) { static bool register_plist_parser(se::Object* obj) { se::Value v; - __ccObj->getProperty("PlistParser", &v); + se::Value jsbVal; + if (!obj->getProperty("jsb", &jsbVal)) + { + se::HandleObject jsbObj(se::Object::createPlainObject()); + jsbVal.setObject(jsbObj); + obj->setProperty("jsb", jsbVal); + } + se::Object* jsb = jsbVal.toObject(); + jsb->getProperty("PlistParser", &v); assert(v.isObject()); v.toObject()->defineFunction("getInstance", _SE(js_PlistParser_getInstance)); @@ -460,6 +469,57 @@ static bool js_cocos2dx_CanvasRenderingContext2D_setCanvasBufferUpdatedCallback( } SE_BIND_FUNC(js_cocos2dx_CanvasRenderingContext2D_setCanvasBufferUpdatedCallback) +static se::Object* __deviceMotionObject = nullptr; +static bool JSB_getDeviceMotionValue(se::State& s) +{ + if (__deviceMotionObject == nullptr) + { + __deviceMotionObject = se::Object::createArrayObject(9); + __deviceMotionObject->root(); + } + + const auto& v = Device::getDeviceMotionValue(); + + __deviceMotionObject->setArrayElement(0, se::Value(v.accelerationX)); + __deviceMotionObject->setArrayElement(1, se::Value(v.accelerationY)); + __deviceMotionObject->setArrayElement(2, se::Value(v.accelerationZ)); + __deviceMotionObject->setArrayElement(3, se::Value(v.accelerationIncludingGravityX)); + __deviceMotionObject->setArrayElement(4, se::Value(v.accelerationIncludingGravityY)); + __deviceMotionObject->setArrayElement(5, se::Value(v.accelerationIncludingGravityZ)); + __deviceMotionObject->setArrayElement(6, se::Value(v.rotationRateAlpha)); + __deviceMotionObject->setArrayElement(7, se::Value(v.rotationRateBeta)); + __deviceMotionObject->setArrayElement(8, se::Value(v.rotationRateGamma)); + + s.rval().setObject(__deviceMotionObject); + return true; +} +SE_BIND_FUNC(JSB_getDeviceMotionValue) + +static bool register_device(se::Object* obj) +{ + se::Value device; + if (!obj->getProperty("Device", &device)) + { + se::HandleObject deviceObj(se::Object::createPlainObject()); + obj->setProperty("Device", se::Value(deviceObj)); + device.setObject(deviceObj); + } + + device.toObject()->defineFunction("getDeviceMotionValue", _SE(JSB_getDeviceMotionValue)); + + se::ScriptEngine::getInstance()->addBeforeCleanupHook([](){ + if (__deviceMotionObject != nullptr) + { + __deviceMotionObject->unroot(); + __deviceMotionObject->decRef(); + __deviceMotionObject = nullptr; + } + }); + + se::ScriptEngine::getInstance()->clearException(); + return true; +} + static bool register_canvas_context2d(se::Object* obj) { _SE_DEFINE_PROP(CanvasRenderingContext2D, _width) @@ -484,6 +544,7 @@ bool register_all_cocos2dx_manual(se::Object* obj) { register_plist_parser(obj); register_sys_localStorage(obj); + register_device(obj); register_canvas_context2d(obj); return true; } diff --git a/native/cocos/scripting/js-bindings/manual/jsb_global.cpp b/native/cocos/scripting/js-bindings/manual/jsb_global.cpp index c6a93fbd5c..0ca7674fed 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_global.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_global.cpp @@ -42,8 +42,6 @@ using namespace cocos2d; using namespace cocos2d::experimental; -se::Object* __jscObj = nullptr; -se::Object* __ccObj = nullptr; se::Object* __jsbObj = nullptr; se::Object* __glObj = nullptr; @@ -1043,32 +1041,6 @@ static bool JSB_hideInputBox(se::State& s) } SE_BIND_FUNC(JSB_hideInputBox) -static se::Object* __deviceMotionObject = nullptr; -static bool JSB_getDeviceMotionValue(se::State& s) -{ - if (__deviceMotionObject == nullptr) - { - __deviceMotionObject = se::Object::createArrayObject(9); - __deviceMotionObject->root(); - } - - const auto& v = Device::getDeviceMotionValue(); - - __deviceMotionObject->setArrayElement(0, se::Value(v.accelerationX)); - __deviceMotionObject->setArrayElement(1, se::Value(v.accelerationY)); - __deviceMotionObject->setArrayElement(2, se::Value(v.accelerationZ)); - __deviceMotionObject->setArrayElement(3, se::Value(v.accelerationIncludingGravityX)); - __deviceMotionObject->setArrayElement(4, se::Value(v.accelerationIncludingGravityY)); - __deviceMotionObject->setArrayElement(5, se::Value(v.accelerationIncludingGravityZ)); - __deviceMotionObject->setArrayElement(6, se::Value(v.rotationRateAlpha)); - __deviceMotionObject->setArrayElement(7, se::Value(v.rotationRateBeta)); - __deviceMotionObject->setArrayElement(8, se::Value(v.rotationRateGamma)); - - s.rval().setObject(__deviceMotionObject); - return true; -} -SE_BIND_FUNC(JSB_getDeviceMotionValue) - bool jsb_register_global_variables(se::Object* global) { __threadPool = ThreadPool::newFixedThreadPool(3); @@ -1076,20 +1048,17 @@ bool jsb_register_global_variables(se::Object* global) global->defineFunction("require", _SE(require)); global->defineFunction("requireModule", _SE(moduleRequire)); - getOrCreatePlainObject_r("cc", global, &__ccObj); - getOrCreatePlainObject_r("jsb", global, &__jsbObj); - getOrCreatePlainObject_r("__jsc__", global, &__jscObj); auto glContextCls = se::Class::create("WebGLRenderingContext", global, nullptr, nullptr); glContextCls->install(); SAFE_DEC_REF(__glObj); __glObj = se::Object::createObjectWithClass(glContextCls); - global->setProperty("__ccgl", se::Value(__glObj)); + global->setProperty("__gl", se::Value(__glObj)); - __jscObj->defineFunction("garbageCollect", _SE(jsc_garbageCollect)); - __jscObj->defineFunction("dumpNativePtrToSeObjectMap", _SE(jsc_dumpNativePtrToSeObjectMap)); + __jsbObj->defineFunction("garbageCollect", _SE(jsc_garbageCollect)); + __jsbObj->defineFunction("dumpNativePtrToSeObjectMap", _SE(jsc_dumpNativePtrToSeObjectMap)); __jsbObj->defineFunction("loadImage", _SE(js_loadImage)); __jsbObj->defineFunction("setDebugViewText", _SE(js_setDebugViewText)); @@ -1099,7 +1068,6 @@ bool jsb_register_global_variables(se::Object* global) __jsbObj->defineFunction("setPreferredFramesPerSecond", _SE(JSB_setPreferredFramesPerSecond)); __jsbObj->defineFunction("showInputBox", _SE(JSB_showInputBox)); __jsbObj->defineFunction("hideInputBox", _SE(JSB_hideInputBox)); - __jsbObj->defineFunction("getDeviceMotionValue", _SE(JSB_getDeviceMotionValue)); global->defineFunction("__getPlatform", _SE(JSBCore_platform)); global->defineFunction("__getOS", _SE(JSBCore_os)); @@ -1121,13 +1089,6 @@ bool jsb_register_global_variables(se::Object* global) delete __threadPool; __threadPool = nullptr; - if (__deviceMotionObject != nullptr) - { - __deviceMotionObject->unroot(); - __deviceMotionObject->decRef(); - __deviceMotionObject = nullptr; - } - PoolManager::getInstance()->getCurrentPool()->clear(); }); @@ -1137,9 +1098,7 @@ bool jsb_register_global_variables(se::Object* global) __moduleCache.clear(); - SAFE_DEC_REF(__ccObj); SAFE_DEC_REF(__jsbObj); - SAFE_DEC_REF(__jscObj); SAFE_DEC_REF(__glObj); }); diff --git a/native/cocos/scripting/js-bindings/manual/jsb_global.h b/native/cocos/scripting/js-bindings/manual/jsb_global.h index 9d4dfe0579..59006db34c 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_global.h +++ b/native/cocos/scripting/js-bindings/manual/jsb_global.h @@ -33,7 +33,6 @@ namespace se { class Value; } -extern se::Object* __ccObj; extern se::Object* __jsbObj; extern se::Object* __glObj; diff --git a/native/cocos/scripting/js-bindings/manual/jsb_module_register.cpp b/native/cocos/scripting/js-bindings/manual/jsb_module_register.cpp index 490499d927..73ea25e73d 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_module_register.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_module_register.cpp @@ -35,6 +35,7 @@ #include "cocos/scripting/js-bindings/auto/jsb_renderer_auto.hpp" #include "cocos/scripting/js-bindings/auto/jsb_gfx_auto.hpp" #include "cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp" +#include "cocos/scripting/js-bindings/auto/jsb_cocos2dx_global_auto.hpp" #include "cocos/scripting/js-bindings/manual/jsb_global.h" #include "cocos/scripting/js-bindings/manual/jsb_node.hpp" @@ -89,6 +90,7 @@ bool jsb_register_all_modules() se->addRegisterCallback(jsb_register_gfx_manual); se->addRegisterCallback(register_all_renderer); se->addRegisterCallback(jsb_register_renderer_manual); + se->addRegisterCallback(register_all_cocos2dx_global); se->addRegisterCallback(register_all_cocos2dx); se->addRegisterCallback(register_all_cocos2dx_manual); se->addRegisterCallback(register_platform_bindings); diff --git a/native/cocos/scripting/js-bindings/manual/jsb_node.cpp b/native/cocos/scripting/js-bindings/manual/jsb_node.cpp index 5dc768d7f1..0be4150b43 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_node.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_node.cpp @@ -1526,11 +1526,17 @@ static bool onReceiveNodeEvent(void* node, ScriptingCore::NodeEventType type) bool jsb_register_Node_manual(se::Object* global) { #if STANDALONE_TEST - auto cls = se::Class::create("Node", __ccObj, nullptr, _SE(Node_constructor)); + se::Object* ccObj = nullptr; + getOrCreatePlainObject_r("cc", global, &ccObj); + auto cls = se::Class::create("Node", ccObj, nullptr, _SE(Node_constructor)); cls->defineStaticFunction("create", _SE(Node_create)); cls->defineProperty("x", _SE(Node_get_x), _SE(Node_set_x)); cls->defineProperty("y", _SE(Node_get_y), _SE(Node_set_y)); cls->defineFunction("ctor", _SE(Node_ctor)); + + se::ScriptEngine::getInstance()->addAfterCleanupHook([](){ + SAFE_DEC_REF(ccObj); + }); #else auto cls = __jsb_cocos2d_Node_proto; #endif diff --git a/native/tools/tojs/cocos2dx.ini b/native/tools/tojs/cocos2dx.ini index 8a8d24589e..930ef41a3c 100644 --- a/native/tools/tojs/cocos2dx.ini +++ b/native/tools/tojs/cocos2dx.ini @@ -5,7 +5,7 @@ prefix = cocos2dx # create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`) # all classes will be embedded in that namespace -target_namespace = cc +target_namespace = jsb android_headers = @@ -30,7 +30,7 @@ replace_headers= # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = FileUtils$ SAXParser CanvasRenderingContext2D CanvasGradient Device +classes = SAXParser CanvasGradient classes_need_extend = @@ -43,13 +43,9 @@ field = # will apply to all class names. This is a convenience wildcard to be able to skip similar named # functions from all classes. -skip = FileUtils::[getFileData setFilenameLookupDictionary destroyInstance getFullPathCache getContents], - SAXParser::[(?!(init))], - Device::[getDeviceMotionValue], - CanvasRenderingContext2D::[setCanvasBufferUpdatedCallback set_.+] +skip = SAXParser::[(?!(init))] -rename_functions = FileUtils::[loadFilenameLookupDictionaryFromFile=loadFilenameLookup], - CanvasRenderingContext2D::[getImageData=_getImageData] +rename_functions = rename_classes = SAXParser::PlistParser @@ -64,8 +60,8 @@ base_classes_to_skip = Ref Clonable # classes that create no constructor # Set is special and we will use a hand-written constructor -abstract_classes = SAXParser Device +abstract_classes = SAXParser -persistent_classes = FileUtils +persistent_classes = classes_owned_by_cpp = diff --git a/native/tools/tojs/cocos2dx_global.ini b/native/tools/tojs/cocos2dx_global.ini new file mode 100644 index 0000000000..af24e5119e --- /dev/null +++ b/native/tools/tojs/cocos2dx_global.ini @@ -0,0 +1,70 @@ +[cocos2d-x] +# the prefix to be added to the generated functions. You might or might not use this in your own +# templates +prefix = cocos2dx_global + +# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`) +# all classes will be embedded in that namespace +target_namespace = + +android_headers = + +android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -DANDROID -D__ANDROID_API__=14 -gcc-toolchain %(gcc_toolchain_dir)s --sysroot=%(androidndkdir)s/platforms/android-14/arch-arm -idirafter %(androidndkdir)s/sources/android/support/include -idirafter %(androidndkdir)s/sysroot/usr/include -idirafter %(androidndkdir)s/sysroot/usr/include/arm-linux-androideabi -idirafter %(clangllvmdir)s/lib64/clang/5.0/include -I%(androidndkdir)s/sources/cxx-stl/llvm-libc++/include + +clang_headers = +clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ + +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external/sources +cocos_flags = -DANDROID + +cxxgenerator_headers = + +# extra arguments for clang +extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s + +# what headers to parse +headers = %(cocosdir)s/cocos/cocos2d.h + +replace_headers= + +# what classes to produce code for. You can use regular expressions here. When testing the regular +# expression, it will be enclosed in "^$", like this: "^Menu*$". + +classes = FileUtils$ CanvasRenderingContext2D Device + +classes_need_extend = + +field = + +# what should we skip? in the format ClassName::[function function] +# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also +# regular expressions, they will not be surrounded by "^$". If you want to skip a whole class, just +# add a single "*" as functions. See bellow for several examples. A special class name is "*", which +# will apply to all class names. This is a convenience wildcard to be able to skip similar named +# functions from all classes. + +skip = FileUtils::[getFileData setFilenameLookupDictionary destroyInstance getFullPathCache getContents], + Device::[getDeviceMotionValue], + CanvasRenderingContext2D::[setCanvasBufferUpdatedCallback set_.+] + +rename_functions = FileUtils::[loadFilenameLookupDictionaryFromFile=loadFilenameLookup], + CanvasRenderingContext2D::[getImageData=_getImageData] + +rename_classes = + +# for all class names, should we remove something when registering in the target VM? +remove_prefix = + +# classes for which there will be no "parent" lookup +classes_have_no_parents = + +# base classes which will be skipped when their sub-classes found them. +base_classes_to_skip = Ref Clonable + +# classes that create no constructor +# Set is special and we will use a hand-written constructor +abstract_classes = Device + +persistent_classes = FileUtils + +classes_owned_by_cpp = diff --git a/native/tools/tojs/genbindings.py b/native/tools/tojs/genbindings.py index 4c626b8012..ae6b4f6337 100755 --- a/native/tools/tojs/genbindings.py +++ b/native/tools/tojs/genbindings.py @@ -148,6 +148,7 @@ def main(): 'cocos2dx_audioengine.ini' : ('cocos2dx_audioengine', 'jsb_cocos2dx_audioengine_auto'), 'gfx.ini': ('gfx', 'jsb_gfx_auto'), 'renderer.ini': ('renderer', 'jsb_renderer_auto'), + 'cocos2dx_global.ini' : ('cocos2d-x', 'jsb_cocos2dx_global_auto'), } target = 'spidermonkey' generator_py = '%s/generator.py' % cxx_generator_root