diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..28a3650 --- /dev/null +++ b/build.bat @@ -0,0 +1,34 @@ +@echo off +setlocal + +cd /d "%~dp0" + +if not exist ".venv\Scripts\python.exe" ( + echo [1/4] Creation de l'environnement virtuel... + py -3 -m venv .venv + if errorlevel 1 goto :error +) + +echo [2/4] Installation des dependances... +".venv\Scripts\python.exe" -m pip install --upgrade pip +if errorlevel 1 goto :error +".venv\Scripts\python.exe" -m pip install -r requirements.txt -e . +if errorlevel 1 goto :error + +echo [3/4] Nettoyage des anciens builds... +if exist build rmdir /s /q build +if exist dist rmdir /s /q dist +if exist ai-typewriter.exe.spec del /q ai-typewriter.exe.spec + +echo [4/4] Compilation Windows one-file... +".venv\Scripts\python.exe" -m PyInstaller --clean --onefile --paths src --name ai-typewriter.exe main.py +if errorlevel 1 goto :error + +echo. +echo Build termine : dist\ai-typewriter.exe +exit /b 0 + +:error +echo. +echo Build echoue. +exit /b 1