From bd060f2a228968b2d35bdf6aae88a37532d188ef Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 21 Feb 2013 17:23:43 +0800 Subject: [PATCH] issue #1733: Updated multi-platform-lua/proj.android/build_native.sh. --- .../proj.android/build_native.sh | 46 ++++--------------- 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/template/multi-platform-lua/proj.android/build_native.sh b/template/multi-platform-lua/proj.android/build_native.sh index 58327ef1a6..a800a1f035 100755 --- a/template/multi-platform-lua/proj.android/build_native.sh +++ b/template/multi-platform-lua/proj.android/build_native.sh @@ -11,8 +11,8 @@ usage: $0 [options] Build C/C++ code for $APPNAME using Android NDK OPTIONS: --s Build externals from source --h this help +-s Build externals from source +-h this help EOF } @@ -30,23 +30,16 @@ done # paths -if [ -z "${NDK_ROOT+aaa}" ]; then -# ... if NDK_ROOT is not set, use "$HOME/bin/android-ndk" - NDK_ROOT="$HOME/bin/android-ndk" +if [ -z "${NDK_ROOT+aaa}" ];then +echo "please define NDK_ROOT" +exit 1 fi -if [ -z "${COCOS2DX_ROOT+aaa}" ]; then -# ... if COCOS2DX_ROOT is not set -# ... find current working directory - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # ... use paths relative to current directory - COCOS2DX_ROOT="$DIR/../../.." - APP_ROOT="$DIR/.." - APP_ANDROID_ROOT="$DIR" -else - APP_ROOT="$COCOS2DX_ROOT"/samples/Lua/"$APPNAME" - APP_ANDROID_ROOT="$COCOS2DX_ROOT"/samples/Lua/"$APPNAME"/proj.android -fi +COCOS2DX_ROOT="$DIR/../../.." +APP_ROOT="$DIR/.." +APP_ANDROID_ROOT="$DIR" echo "NDK_ROOT = $NDK_ROOT" echo "COCOS2DX_ROOT = $COCOS2DX_ROOT" @@ -61,18 +54,6 @@ fi mkdir "$APP_ANDROID_ROOT"/assets # copy resources -for file in "$APP_ROOT"/../../Cpp/TestCpp/Resources/* -do -if [ -d "$file" ]; then - cp -rf "$file" "$APP_ANDROID_ROOT"/assets -fi - -if [ -f "$file" ]; then - cp "$file" "$APP_ANDROID_ROOT"/assets -fi -done - -# copy luaScript for file in "$APP_ROOT"/Resources/* do if [ -d "$file" ]; then @@ -84,13 +65,6 @@ if [ -f "$file" ]; then fi done -# remove test_image_rgba4444.pvr.gz -rm -f "$APP_ANDROID_ROOT"/assets/Images/test_image_rgba4444.pvr.gz -rm -f "$APP_ANDROID_ROOT"/assets/Images/test_1021x1024_rgba8888.pvr.gz -rm -f "$APP_ANDROID_ROOT"/assets/Images/test_1021x1024_rgb888.pvr.gz -rm -f "$APP_ANDROID_ROOT"/assets/Images/test_1021x1024_rgba4444.pvr.gz -rm -f "$APP_ANDROID_ROOT"/assets/Images/test_1021x1024_a8.pvr.gz - if [[ "$buildexternalsfromsource" ]]; then echo "Building external dependencies from source" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ @@ -99,4 +73,4 @@ else echo "Using prebuilt externals" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" -fi +fi \ No newline at end of file