mirror of https://github.com/axmolengine/axmol.git
issue #919:make create project support global variable
This commit is contained in:
parent
ae329f62ca
commit
c2761cc84f
|
@ -9,9 +9,9 @@ NDK_ROOT_LOCAL="/home/laschweinski/android/android-ndk-r5"
|
|||
ANDROID_SDK_ROOT_LOCAL="/home/laschweinski/android/android-sdk-linux_86"
|
||||
|
||||
# try to get global variable
|
||||
if [ $ANDROID_NDK_ROOT"aaa" != "aaa" ]; then
|
||||
echo "use global definition of NDK_ROOT: $ANDROID_NDK_ROOT"
|
||||
NDK_ROOT_LOCAL=$ANDROID_NDK_ROOT
|
||||
if [ $NDK_ROOT"aaa" != "aaa" ]; then
|
||||
echo "use global definition of NDK_ROOT: $NDK_ROOT"
|
||||
NDK_ROOT_LOCAL=$NDK_ROOT
|
||||
fi
|
||||
|
||||
if [ $ANDROID_SDK_ROOT"aaa" != "aaa" ]; then
|
||||
|
|
|
@ -5,19 +5,19 @@
|
|||
# Don't modify the script until you know what you do.
|
||||
|
||||
# set environment paramters
|
||||
NDK_ROOT="/home/zhangxm/bin/android-ndk-r6b"
|
||||
ANDROID_SDK_ROOT="/home/zhangxm/bin/android-sdk-linux_x86"
|
||||
COCOS2DX_ROOT="/home/zhangxm/cocos2d-x"
|
||||
NDK_ROOT_LOCAL="/home/zhangxm/bin/android-ndk-r6b"
|
||||
ANDROID_SDK_ROOT_LOCAL="/home/zhangxm/bin/android-sdk-linux_x86"
|
||||
|
||||
# check if it was called by .bat file
|
||||
if [ $# -eq 5 ];then
|
||||
if [ $5 = "windows" ];then
|
||||
# called by .bat file
|
||||
sh $1/template/linux/copy_files.sh $1 $2 $3 $4
|
||||
exit
|
||||
fi
|
||||
# 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 [ $ANDROID_SDK_ROOT"aaa" != "aaa" ]; then
|
||||
echo "use global definition of ANDROID_SDK_ROOT: $ANDROID_SDK_ROOT"
|
||||
ANDROID_SDK_ROOT_LOCAL=$ANDROID_SDK_ROOT
|
||||
fi
|
||||
|
||||
# the bash file should not be called by cygwin
|
||||
KERNEL_NAME=`uname -s | grep "CYGWIN*"`
|
||||
|
@ -30,20 +30,20 @@ fi
|
|||
# ok, it was run under linux
|
||||
|
||||
# check it was runned in cocos2d-x root
|
||||
#check_path(){
|
||||
# if [ ! -f create-android-project.sh ];then
|
||||
# echo Error!!!
|
||||
# echo Please run in cocos2dx root
|
||||
# exit
|
||||
# fi
|
||||
#}
|
||||
check_path(){
|
||||
if [ ! -f create-linux-android-project.sh ];then
|
||||
echo Error!!!
|
||||
echo Please run in cocos2dx root
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
create_android_project(){
|
||||
echo "Input package path. For example: org.cocos2dx.example"
|
||||
read PACKAGE_PATH
|
||||
echo "Now cocos2d-x suppurts Android 2.1-update1, 2.2, 2.3 & 3.0"
|
||||
echo "Other versions have not tested."
|
||||
$ANDROID_SDK_ROOT/tools/android list targets
|
||||
$ANDROID_SDK_ROOT_LOCAL/tools/android list targets
|
||||
echo "input target id:"
|
||||
read TARGET_ID
|
||||
echo "input your project name:"
|
||||
|
@ -52,11 +52,11 @@ create_android_project(){
|
|||
PROREAL_DIR=$PROJECT_NAME
|
||||
PROJECT_NAME=An$PROJECT_NAME
|
||||
|
||||
$ANDROID_SDK_ROOT/tools/android create project -n $PROJECT_NAME -t $TARGET_ID -k $PACKAGE_PATH -a $PROJECT_NAME -p $PROJECT_DIR
|
||||
$ANDROID_SDK_ROOT_LOCAL/tools/android create project -n $PROJECT_NAME -t $TARGET_ID -k $PACKAGE_PATH -a $PROJECT_NAME -p $PROJECT_DIR
|
||||
}
|
||||
|
||||
#check_path
|
||||
check_path
|
||||
create_android_project
|
||||
|
||||
# invoke template/android/copy_files.sh
|
||||
sh $COCOS2DX_ROOT/template/linux/mycopy_files.sh $COCOS2DX_ROOT $PROJECT_NAME $NDK_ROOT $PACKAGE_PATH $PROREAL_DIR
|
||||
sh $`pwd`/template/linux/mycopy_files.sh `pwd` $PROJECT_NAME $NDK_ROOT_LOCAL $PACKAGE_PATH $PROREAL_DIR
|
||||
|
|
Loading…
Reference in New Issue