-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_exe.bat
More file actions
47 lines (38 loc) · 1.28 KB
/
build_exe.bat
File metadata and controls
47 lines (38 loc) · 1.28 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
@echo off
setlocal
chcp 65001 >nul
cd /d "%~dp0"
set "PROJECT_ROOT=%CD%"
set "SCANNER=%PROJECT_ROOT%\..\..\_tools\build_exclude_scanner.py"
set "BUILD_ROOT=C:\_Local_DEV\codex_build\methodenanalyser"
set "DIST_DIR=%PROJECT_ROOT%\dist"
if not exist "%SCANNER%" (
echo [FEHLER] Build-Exclude-Scanner nicht gefunden:
echo %SCANNER%
exit /b 1
)
where python >nul 2>&1
if errorlevel 1 (
echo [FEHLER] Python wurde nicht gefunden.
exit /b 1
)
for /f "delims=" %%E in ('python "%SCANNER%" --project "%PROJECT_ROOT%" --emit pyinstaller') do set "EXCLUDES=%%E"
if not exist "%BUILD_ROOT%" mkdir "%BUILD_ROOT%"
if not exist "%DIST_DIR%" mkdir "%DIST_DIR%"
python -m PyInstaller --noconfirm --clean --windowed --onefile ^
--name MethodenAnalyser ^
--icon "%PROJECT_ROOT%\MethodenAnalyser.ico" ^
%EXCLUDES% ^
--distpath "%BUILD_ROOT%\dist" ^
--workpath "%BUILD_ROOT%\build" ^
--specpath "%BUILD_ROOT%" ^
"%PROJECT_ROOT%\MethodenAnalyser3.py"
if errorlevel 1 (
echo [FEHLER] PyInstaller-Build fehlgeschlagen.
exit /b 1
)
copy /Y "%BUILD_ROOT%\dist\MethodenAnalyser.exe" "%DIST_DIR%\MethodenAnalyser.exe" >nul
copy /Y "%BUILD_ROOT%\dist\MethodenAnalyser.exe" "%PROJECT_ROOT%\MethodenAnalyser.exe" >nul
echo [OK] EXE gebaut:
echo %DIST_DIR%\MethodenAnalyser.exe
endlocal