ro-webgl/Build/BuildTools/autobuild.bat
2021-12-21 09:40:39 +08:00

68 lines
1.5 KiB
Batchfile
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo Off
setlocal EnableDelayedExpansion
echo.
echo ===========================================
echo 检查编译环境
echo ===========================================
echo.
cd /d "%~dp0"
python --version
if ERRORLEVEL 1 goto :PythonCommandError
goto :CommandBuild
:PythonCommandError
for /f "delims=" %%i in ('REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath" /VE ') do set InstallDir=%%i
if "%InstallDir%" == "" goto :PythonInstallError
set InstallDir=%InstallDir:~22%
if not exist %InstallDir% goto :PythonInstallError
goto :PathBuild
:CommandBuild
python PackTools\PackTools.py %1 %2 %3 %4 %5 %6 %7 %8 %9
if ERRORLEVEL 1 goto :Fail
if ERRORLEVEL 2 goto :Success
goto :Common
:PathBuild
"%InstallDir%\python.exe" PackTools\PackTools.py %1 %2 %3 %4 %5 %6 %7 %8 %9
if ERRORLEVEL 1 goto :Fail
if ERRORLEVEL 2 goto :Success
goto :Common
:ColorTheStr
>"%~2" set /p=<nul&findstr /a:%1 .* "%~2*"&del "%~2*" &&set /p=<EFBFBD><nul
echo.
goto :eof
:PythonInstallError
echo.
echo.
call :ColorTheStr 0C "==========================================="
call :ColorTheStr 0C "     编译错误Python2.7未安装"
call :ColorTheStr 0C " 请安装Python2.7"
call :ColorTheStr 0C "==========================================="
echo.
goto :Fail
:Fail
echo.
call :ColorTheStr 0C "编译失败"
echo.
goto :Exit
:Success
echo.
call :ColorTheStr 02 "编译成功"
echo.
goto :Exit
:Common
goto :Exit
:Exit