2011-03-23 14:30:14 +08:00
|
|
|
# set params
|
|
|
|
ANDROID_NDK_ROOT=__ndkroot__
|
|
|
|
COCOS2DX_ROOT=__cocos2dxroot__
|
2011-05-09 15:21:08 +08:00
|
|
|
GAME_ROOT=$COCOS2DX_ROOT/__projectname__
|
|
|
|
GAME_ANDROID_ROOT=$GAME_ROOT/android
|
|
|
|
RESOURCE_ROOT=$GAME_ROOT/Resource
|
2011-03-23 14:30:14 +08:00
|
|
|
|
|
|
|
# make sure assets is exist
|
2011-05-09 15:21:08 +08:00
|
|
|
if [ -d $GAME_ANDROID_ROOT/assets ]; then
|
|
|
|
rm -rf $GAME_ANDROID_ROOT/assets
|
2011-03-23 14:30:14 +08:00
|
|
|
fi
|
|
|
|
|
2011-05-09 15:21:08 +08:00
|
|
|
mkdir $GAME_ANDROID_ROOT/assets
|
2011-03-23 14:30:14 +08:00
|
|
|
|
|
|
|
# copy resources
|
|
|
|
for file in $RESOURCE_ROOT/*
|
|
|
|
do
|
|
|
|
if [ -d $file ]; then
|
2011-05-09 15:21:08 +08:00
|
|
|
cp -rf $file $GAME_ANDROID_ROOT/assets
|
2011-03-23 14:30:14 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f $file ]; then
|
2011-05-09 15:21:08 +08:00
|
|
|
cp $file $GAME_ANDROID_ROOT/assets
|
2011-03-23 14:30:14 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# build
|
2011-05-09 15:21:08 +08:00
|
|
|
$ANDROID_NDK_ROOT/ndk-build -C $GAME_ANDROID_ROOT $*
|
2011-03-23 14:30:14 +08:00
|
|
|
|