jsb_cocos2dx_auto.cpp is awkwardly large


#1

I just wanted to ask about the logic in having all of the automatic JS bindings in one file. This file is large enough that it regularly causes problems with xCode, and compiling just that file for android takes several minutes.

I wind up adding debugging code to the auto JS bindings fairly often when I’m hunting down bugs, and it would be a lot easier to work with if it were split up into a dozen or so files.


#2

Yes, it does take much time to compile. But if we separate it according class name, there will be lots of files since there are 100 more classes exposed to JS.

it would be a lot easier to work with if it were split up into a dozen or so files.

But how to decide where is the end of a file?


#3

How about splitting them up by the folder the class was from? i.e. “sprite_nodes”, “label_nodes”, etc.

In all honestly, for auto generated code like that, having them arbitrarily split up between “jsb_cocos2dx_bindings_1” to “jsb_cocos2dx_bindings_12” would be preferable to the current state. In any moden IDE it’s easy enough to search across multiple files.


#4

Issue http://www.cocos2d-x.org/issues/2126 was created. Thanks for your feedback.