Document 'magic' behind shell script files

Document 'magic' behind shell script files
0.0 0


The cocos2dx project comes with, and encourages the use of the batch files in order to create a project.
However what goes on in those batch files is either not documented ( I could not locate it ), or very poorly documented.

It takes a lot of reverse engineering, and pretending to be a machine and carry state in your head in order to determine which branches of logic are being carried out and then mimicking that to create a project.

My intent was to create an androidSDK project, add convert it into a C++ NDK project, then finally add Cocos2dx to it in eclipse.
I was able to pull this off only after spending at least 15-20 hours trying to reproduce what goes on in various files, determine various magic paths etc.


Please refer
There are many documents.
I don’t know which batch file confused you.


Hi Minggo,

I did look over those documents, extensively. And they were a great help however they only make my point.
Many of them are outdated yet listed next above ones which are more current.
Some of them contradict one another.

For example:
‘Define environment variables “NDK_ROOT” and “COCOS2DX_ROOT”’

Followed by:
‘Change “NDK_ROOT_LOCAL” and “COCOS2DX_ROOT_LOCAL” in HelloWorld/android/’

The actual solution, is to literally map NDK_ROOT_LOCAL to NDK_ROOT, and COCOS2DX_ROOT_LOCAL to COCOS2DX.
Why not just change the shell script itself? There’s no documentation stating WHY we are doing this unnatural modification.

It basically says - Step 1 - create the project. Step 2b, comes before step 1.4 which requires step 2 to be correct.

Next file:
Something about running on Android 3.0

This specifically discusses r5, however we are several versions beyond that…
How do i know? I painfully found that out by failing over and over.

These are just the first two links, that are not listed as ‘deprecated’ which actually are placed between the two i just mentioned.

I think the project is amazing, I just would like some clear formal documentation.
Many people willing to dance with NDK + C++, are also the people who prefer to do it themselves but right now we cannot do that unless we reverse engineer a script.

Simple documentation will really help.

PS. I was at your talk @ GDC, awesome stuff.
Already a cocos2d-iphone fan, so seeing how serious you guys are about this project is really exciting.