2011-03-23 09:42:23 +08:00
|
|
|
@echo off
|
|
|
|
setlocal
|
|
|
|
|
|
|
|
if not exist "%~dpn0.sh" echo Script "%~dpn0.sh" not found & exit 2
|
|
|
|
|
2011-03-23 14:30:14 +08:00
|
|
|
:: modify it to work under your environment
|
2011-03-23 09:42:23 +08:00
|
|
|
set _CYGBIN=f:\cygwin\bin
|
|
|
|
if not exist "%_CYGBIN%" echo Couldn't find Cygwin at "%_CYGBIN%" & exit 3
|
|
|
|
|
2011-03-23 14:30:14 +08:00
|
|
|
:: modify it to work under your environment
|
2011-03-23 09:42:23 +08:00
|
|
|
set _ANDROIDTOOLS=d:\android-sdk\tools
|
2011-03-23 14:30:14 +08:00
|
|
|
if not exist "%_ANDROIDTOOLS%" echo Couldn't find android sdk tools at "%_ANDROIDTOOLS%" & exit 4
|
|
|
|
|
|
|
|
:: modify it to work under your environment
|
|
|
|
set _NDKROOT=e:\android-ndk-r4-crystax
|
|
|
|
if not exist "%_NDKROOT%" echo Couldn't find ndk at "%_NDKROOT%" & exit 5
|
2011-03-23 09:42:23 +08:00
|
|
|
|
|
|
|
:: create android project
|
|
|
|
set _TARGETID=3
|
|
|
|
set _PACKAGEPATH=org.cocos2dx.application
|
|
|
|
set /P _PROJECTNAME=Please enter your project name:
|
|
|
|
set _PROJECTDIR=%CD%\%_PROJECTNAME%
|
|
|
|
|
|
|
|
echo Create android project
|
|
|
|
call %_ANDROIDTOOLS%\android.bat create project -n %_PROJECTNAME% -t %_TARGETID% -k %_PACKAGEPATH% -a %_PROJECTNAME% -p %_PROJECTDIR%
|
|
|
|
|
|
|
|
:: Resolve ___.sh to /cygdrive based *nix path and store in %_CYGSCRIPT%
|
|
|
|
for /f "delims=" %%A in ('%_CYGBIN%\cygpath.exe "%~dpn0.sh"') do set _CYGSCRIPT=%%A
|
|
|
|
|
|
|
|
:: Resolve current dir to cygwin path
|
|
|
|
for /f "delims=" %%A in ('%_CYGBIN%\cygpath.exe "%cd%"') do set _CURRENTDIR=%%A
|
|
|
|
|
2011-03-23 14:30:14 +08:00
|
|
|
:: Resolve ndk dir to cygwin path
|
|
|
|
for /f "delims=" %%A in ('%_CYGBIN%\cygpath.exe "%_NDKROOT%"') do set _NDKROOT=%%A
|
2011-03-23 09:42:23 +08:00
|
|
|
|
|
|
|
:: Throw away temporary env vars and invoke script, passing any args that were passed to us
|
2011-03-23 14:30:14 +08:00
|
|
|
endlocal & %_CYGBIN%\bash --login "%_CYGSCRIPT%" %_CURRENTDIR% %_PROJECTNAME% %_NDKROOT% "windows"
|