forked from Justinyu1618/terminal_blackjack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
87 lines (77 loc) · 2.47 KB
/
build.bat
File metadata and controls
87 lines (77 loc) · 2.47 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@echo off
REM PyInstaller build script for Windjack game
REM Created: July 4, 2025
echo ========================================
echo Building Windjack Game with PyInstaller
echo ========================================
REM Check if PyInstaller is installed
pyinstaller --version >nul 2>&1
if %errorlevel% neq 0 (
echo PyInstaller not found. Installing PyInstaller...
pip install pyinstaller
if %errorlevel% neq 0 (
echo Failed to install PyInstaller. Please install it manually.
pause
exit /b 1
)
)
REM Create build directory if it doesn't exist
if not exist "build" mkdir build
if not exist "dist" mkdir dist
echo.
echo Cleaning previous builds...
if exist "build\game" rmdir /s /q "build\game"
if exist "dist\windjack.exe" del /q "dist\windjack.exe"
echo.
echo Building executable...
REM PyInstaller command with options:
REM --onefile: Create a single executable file
REM --windowed: Hide console window (remove this if you want console visible)
REM --name: Set the name of the executable
REM --icon: Add an icon (uncomment and provide path if you have one)
REM --add-data: Include additional data files
REM --hidden-import: Include modules that might not be auto-detected
REM --exclude-module: Exclude unnecessary modules to reduce size
pyinstaller ^
--onefile ^
--console ^
--name windjack ^
--distpath dist ^
--workpath build ^
--specpath . ^
--hidden-import=windows-curses ^
--hidden-import=curses ^
--add-data "src;src" ^
--exclude-module=tkinter ^
--exclude-module=matplotlib ^
--exclude-module=PIL ^
--exclude-module=numpy ^
--exclude-module=scipy ^
game.py
REM Check if build was successful
if %errorlevel% equ 0 (
echo.
echo ========================================
echo Build completed successfully!
echo ========================================
echo.
echo Executable location: dist\windjack.exe
echo File size:
for %%A in ("dist\windjack.exe") do echo %%~zA bytes
echo.
echo You can now run the game with: dist\windjack.exe
echo.
) else (
echo.
echo ========================================
echo Build failed!
echo ========================================
echo Please check the error messages above.
echo.
)
REM Optional: Clean up build files (uncomment if desired)
REM echo Cleaning up build files...
REM if exist "build" rmdir /s /q "build"
REM if exist "windjack.spec" del /q "windjack.spec"
echo Press any key to exit...
pause >nul