-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.bat
More file actions
54 lines (44 loc) · 1.26 KB
/
build.bat
File metadata and controls
54 lines (44 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@echo off
setlocal enabledelayedexpansion
set SCRIPT_NAME=SLScheevo.py
set OUTPUT_NAME=SLScheevo.exe
set VENV_DIR=.venv
echo Setting up build environment...
:: Check if Python is available
python --version >nul 2>&1
if errorlevel 1 (
echo Error: Python could not be found
echo Please make sure Python is installed and in your PATH
pause
exit /b 1
)
:: Create virtual environment
echo Creating Python virtual environment...
python -m venv .venv
:: Activate virtual environment
echo Activating virtual environment...
call .venv\Scripts\activate.bat
:: Install requirements
echo Installing requirements...
python -m pip install --upgrade pip setuptools wheel pyinstaller
pip install -r requirements.txt
REM Create build directory
if not exist build mkdir build
REM Build with PyInstaller
echo Building executable with PyInstaller...
pyinstaller --onefile ^
--name "%OUTPUT_NAME%" ^
--distpath ./build ^
--workpath ./build/temp ^
--specpath ./build ^
"%SCRIPT_NAME%"
REM Check build result
if exist "./build/%OUTPUT_NAME%" (
echo Build successful! Executable created: ./build/%OUTPUT_NAME%
) else (
echo Build failed!
pause
exit /b 1
)
call "%VENV_DIR%\Scripts\deactivate.bat"
echo Done!