-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile.bat
More file actions
54 lines (41 loc) · 1.31 KB
/
compile.bat
File metadata and controls
54 lines (41 loc) · 1.31 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 APP_NAME=Sentry
set ENTRY=run.py
echo [1/7] Cleaning previous builds...
if exist venv rd /s /q venv
if exist build rd /s /q build
if exist dist rd /s /q dist
echo [2/7] Creating virtual environment...
python -m venv venv
call venv\Scripts\activate.bat
echo [3/7] Installing application dependencies...
python -m pip install -U pip
pip install -r requirements.txt
echo [4/7] Generating THIRD_PARTY_NOTICES.txt...
pip install pip-licenses
pip-licenses ^
--with-urls ^
--with-license-file ^
--with-notice-file ^
--format=plain-vertical ^
--ignore-packages pip-licenses prettytable wcwidth pip setuptools wheel ^
--output-file THIRD_PARTY_NOTICES.raw.txt
findstr /V /R "^[a-zA-Z]:" THIRD_PARTY_NOTICES.raw.txt > THIRD_PARTY_NOTICES.txt
del THIRD_PARTY_NOTICES.raw.txt
echo [5/7] Running Security Audit...
pip install pip-audit
pip-audit -r requirements.txt
if %ERRORLEVEL% NEQ 0 (
echo WARNING: Security vulnerabilities found!
pause
)
echo [6/7] Building EXE with PyInstaller...
pip install pyinstaller
pyinstaller --clean --noconfirm --onefile --noconsole --name "%APP_NAME%" "%ENTRY%"
echo [7/7] Finalizing...
copy /Y THIRD_PARTY_NOTICES.txt dist\THIRD_PARTY_NOTICES.txt >nul
echo.
echo Build Complete. Binary is in the 'dist' folder.
pause
endlocal