Suggestion to improve development environment

Suggestion to improve development environment
0.0 0


Hi, folks.

Everyone who wants to develop needs to open cocos2d-x scripts and change some variables to reflect configuration in its own machine.

I’m talking specifically about ANDROID_NDK_ROOT and COCOS2DX_ROOT (please add here more global variables you’re aware of).

Instead of have them hard coded into cocos2d-x scripts why don’t you remove their definitions from scripts and let users set it globally?

A wiki page could explain how to set global variables on Windows, Linux and Mac.

It would be done just once instead of once for each script one would use.

Moreover, It would even relief the burden of update all scripts every time users got a new version of cocos2d-x.




Good idea. I just thought about this problem when I setting Hudson.
The priority should be:
# ndk /blabla/android-ndk-r72dx /blabla/cocos2d-x // if user input a parameter, then it’s the highest priority
# global variables, as you said
# dump helping texts, if the script cannot find the variables from neither input parameter nor global variables.

Issue #919. How about your opinion?


Hi, Walzer.

I thing I haven’t understood what you proposed very well.

Do you want to keep variables on scripts and enable users to override them using parameters in the command line?

If it is, I don’t thing it’s a good Idea. It would be one more way to mess things up.

I still think that scripts should rely on global variables enabled in the environment (for instance, defined in bashrc file on Linux).

Do you see problems with this approach?




I think we should keep compatible with old version.
So my plan and design is:

  1. use global variables first
  2. if not define global variables, use default definitions in the script, just as now it works.


@Miggo This way is much better.




ok, thank you.