one thing you can do by modifying Android.mk in JNI folder and Genrating a Andriod.mk file which points to game classes.
setp 1. put all the .cpp and .h file is Classes folder [without any subfolders] … i know sounds unorganized but it works.
step 2. : download “genrateMakeFile.sh”
step 3 : put it in proj.android folder
setp 4 : modify Android.mk in JNI folder like
search for line :
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static
to
LOCAL_WHOLE_STATIC_LIBRARIES := cocos_game_common cocos2dx_static cocosdenshion_static cocos_extension_static
add “cocos_game_common”
or if you see structure like this
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
to
LOCAL_WHOLE_STATIC_LIBRARIES := cocos_game_common
LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
“cocos_game_common” that is name of the module for all the game classes in /Classes folder
THEN
at the end of Android.mk file
add one line like
$(call import-module,CocosDenshion/android) \
$(call import-module,cocos2dx) \
$(call import-module,extensions)
to
$(call import-module,gameFolder/Classes) \
$(call import-module,CocosDenshion/android) \
$(call import-module,cocos2dx) \
$(call import-module,extensions)
gameFolder is the name of the folder in your COCOS2DX root in which your cocos2dx project in generated.
AFTER modifing the make file just put one line in build_native.sh , you must add it to first line of build_native.sh
./genrateMakeFile.sh
DONE
whenever you run ./build_native.sh all the classes in /Classes folder will be complied , limitation of my script is .cpp and .h should not be in subfolders.
Whenever i need to test for android i do this way only. peace .