2013-10-18 06:35:54 +00:00
|
|
|
@ECHO OFF
|
2015-05-03 04:46:42 +00:00
|
|
|
REM Copyright 2015 Ben Vanik. All Rights Reserved.
|
2013-10-18 06:35:54 +00:00
|
|
|
|
|
|
|
SET DIR=%~dp0
|
|
|
|
|
2015-05-03 04:46:42 +00:00
|
|
|
REM ============================================================================
|
|
|
|
REM Environment Validation
|
|
|
|
REM ============================================================================
|
|
|
|
|
|
|
|
CALL :check_python
|
|
|
|
IF %_RESULT% NEQ 0 (
|
2015-11-25 23:22:53 +00:00
|
|
|
ECHO.
|
2017-09-21 21:42:57 +00:00
|
|
|
ECHO Python 3.4+ must be installed and on PATH:
|
|
|
|
ECHO https://www.python.org/
|
2015-05-03 04:46:42 +00:00
|
|
|
GOTO :exit_error
|
|
|
|
)
|
|
|
|
|
2015-06-23 04:49:25 +00:00
|
|
|
|
2015-05-03 04:46:42 +00:00
|
|
|
REM ============================================================================
|
2015-08-01 06:48:24 +00:00
|
|
|
REM Trampoline into xenia-build
|
2015-05-03 04:46:42 +00:00
|
|
|
REM ============================================================================
|
|
|
|
|
2015-11-25 23:22:53 +00:00
|
|
|
%PYTHON_EXE% xenia-build %*
|
2015-08-01 06:48:24 +00:00
|
|
|
EXIT /b %ERRORLEVEL%
|
2015-05-03 04:46:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
REM ============================================================================
|
|
|
|
REM Utilities
|
|
|
|
REM ============================================================================
|
|
|
|
|
|
|
|
:check_python
|
|
|
|
SETLOCAL
|
2015-11-25 23:22:53 +00:00
|
|
|
SET FOUND_PYTHON_EXE=""
|
2017-09-21 21:42:57 +00:00
|
|
|
1>NUL 2>NUL CMD /c where python3
|
2015-11-25 23:22:53 +00:00
|
|
|
IF NOT ERRORLEVEL 1 (
|
2017-09-21 21:42:57 +00:00
|
|
|
SET FOUND_PYTHON_EXE=python3
|
2015-11-25 23:22:53 +00:00
|
|
|
)
|
2016-09-28 23:30:45 +00:00
|
|
|
IF %FOUND_PYTHON_EXE% EQU "" (
|
2017-09-21 21:42:57 +00:00
|
|
|
IF EXIST c:\\python34\\python.exe SET FOUND_PYTHON_EXE=C:\\python34\\python.exe
|
|
|
|
)
|
|
|
|
IF %FOUND_PYTHON_EXE% EQU "" (
|
|
|
|
IF EXIST c:\\python35\\python.exe SET FOUND_PYTHON_EXE=C:\\python35\\python.exe
|
|
|
|
)
|
|
|
|
IF %FOUND_PYTHON_EXE% EQU "" (
|
|
|
|
IF EXIST c:\\python36\\python.exe SET FOUND_PYTHON_EXE=C:\\python36\\python.exe
|
2016-09-28 23:30:45 +00:00
|
|
|
)
|
2015-11-25 23:22:53 +00:00
|
|
|
IF %FOUND_PYTHON_EXE% EQU "" (
|
|
|
|
1>NUL 2>NUL CMD /c where python
|
|
|
|
IF NOT ERRORLEVEL 1 (
|
|
|
|
SET FOUND_PYTHON_EXE=python
|
|
|
|
)
|
|
|
|
)
|
|
|
|
IF %FOUND_PYTHON_EXE% EQU "" (
|
|
|
|
ECHO ERROR: no Python executable found on PATH.
|
2017-09-21 21:42:57 +00:00
|
|
|
ECHO Make sure you can run 'python' or 'python3' in a Command Prompt.
|
2015-05-03 04:46:42 +00:00
|
|
|
ENDLOCAL & SET _RESULT=1
|
|
|
|
GOTO :eof
|
|
|
|
)
|
2017-09-21 21:42:57 +00:00
|
|
|
CMD /C %FOUND_PYTHON_EXE% -c "import sys; sys.exit(1 if not sys.version_info[:2] >= (3, 4) else 0)"
|
2015-05-03 04:46:42 +00:00
|
|
|
IF %ERRORLEVEL% NEQ 0 (
|
2017-09-21 21:42:57 +00:00
|
|
|
ECHO ERROR: Python version mismatch - not 3.4+
|
2015-05-03 04:46:42 +00:00
|
|
|
ENDLOCAL & SET _RESULT=1
|
|
|
|
GOTO :eof
|
|
|
|
)
|
2015-11-25 23:22:53 +00:00
|
|
|
ENDLOCAL & (
|
|
|
|
SET _RESULT=0
|
|
|
|
SET PYTHON_EXE=%FOUND_PYTHON_EXE%
|
|
|
|
)
|
2015-05-03 04:46:42 +00:00
|
|
|
GOTO :eof
|