axmol/tests/test.android/build_native.sh

46 lines
1000 B
Bash
Raw Normal View History

#!/bin/bash
# set params
NDK_ROOT_LOCAL=/cygdrive/e/android/android-ndk-r6b
COCOS2DX_ROOT_LOCAL=/cygdrive/f/Project/dumganhar/cocos2d-x
2011-12-20 16:50:39 +08:00
# try to get global variable
if [ $NDK_ROOT"aaa" != "aaa" ]; then
echo "use global definition of NDK_ROOT: $NDK_ROOT"
NDK_ROOT_LOCAL=$NDK_ROOT
fi
if [ $COCOS2DX_ROOT"aaa" != "aaa" ]; then
echo "use global definition of COCOS2DX_ROOT: $COCOS2DX_ROOT"
COCOS2DX_ROOT_LOCAL=$COCOS2DX_ROOT
fi
TESTS_ROOT=$COCOS2DX_ROOT_LOCAL/tests/test.android
2010-12-20 14:17:51 +08:00
2011-01-19 16:00:19 +08:00
# make sure assets is exist
2011-01-21 15:45:55 +08:00
if [ -d $TESTS_ROOT/assets ]; then
rm -rf $TESTS_ROOT/assets
2011-01-19 16:00:19 +08:00
fi
2011-01-21 15:45:55 +08:00
mkdir $TESTS_ROOT/assets
2011-01-19 16:00:19 +08:00
# copy resources
for file in $COCOS2DX_ROOT_LOCAL/tests/Resources/*
2011-01-21 15:45:55 +08:00
do
if [ -d $file ]; then
cp -rf $file $TESTS_ROOT/assets
fi
if [ -f $file ]; then
cp $file $TESTS_ROOT/assets
fi
done
2010-12-20 14:17:51 +08:00
# remove test_image_rgba4444.pvr.gz
rm -f $TESTS_ROOT/assets/Images/test_image_rgba4444.pvr.gz
2010-12-20 14:17:51 +08:00
#build
2011-12-20 16:50:39 +08:00
pushd $NDK_ROOT_LOCAL
./ndk-build -C $TESTS_ROOT $*
popd