fixed #910: when create new android project, not delete existing directory

This commit is contained in:
minggo 2011-12-29 10:39:46 +08:00
parent 8664bc6607
commit 5c04551567
2 changed files with 8 additions and 1 deletions

View File

@ -23,8 +23,9 @@ set _NDKROOT=d:\programe\android\ndk\android-ndk-r6b
if not exist "%_NDKROOT%" echo Couldn't find ndk at "%_NDKROOT%" & pause & exit 6
:: create android project
set /P _PACKAGEPATH=Please enter your package path:
set /P _PACKAGEPATH=Please enter your package path. For example: org.cocos2dx.example:
set /P _PROJECTNAME=Please enter your project name:
if exist "%CD%\%_PROJECTNAME%" echo "%_PROJECTNAME%" exists, please use another name & pause & exit 7
echo "Now cocos2d-x suppurts Android 2.1-update1, 2.2, 2.3 & 3.0"
echo "Other versions have not tested."
call "%_ANDROIDTOOLS%\android.bat" list targets

View File

@ -59,6 +59,12 @@ create_android_project(){
echo "input your project name:"
read PROJECT_NAME
PROJECT_DIR=`pwd`/$PROJECT_NAME
# check if PROJECT_DIR is exist
if [ -d $PROJECT_DIR ]; then
echo "$PROJECT_DIR is exist, please use another name"
exit
fi
$ANDROID_SDK_ROOT_LOCAL/tools/android create project -n $PROJECT_NAME -t $TARGET_ID -k $PACKAGE_PATH -a $PROJECT_NAME -p $PROJECT_DIR
}