-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_release.bat
More file actions
95 lines (78 loc) · 2.28 KB
/
Copy pathbuild_release.bat
File metadata and controls
95 lines (78 loc) · 2.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
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
88
89
90
91
92
93
94
95
@echo off
setlocal EnableDelayedExpansion
REM ========================================================
REM FileEcho One-Click Release Builder
REM ========================================================
set "VERSION=1.1.1"
echo.
echo FileEcho v%VERSION% - Release Builder
echo ========================================================
echo.
echo [0/5] Initializing Environment...
REM Switch to script directory
cd /d "%~dp0"
REM 1. Get the 8.3 Short Path of the CURRENT DIRECTORY (.)
REM This ensures CMake receives "D:\FILEEC~1" instead of "D:\FileEcho - Copy"
REM preventing all space-related errors.
for %%I in (.) do set "SOURCE_DIR=%%~sfsI"
set "BUILD_DIR=build"
set "DIST_DIR=dist\FileEcho-v%VERSION%"
echo - Source: %SOURCE_DIR%
echo - Build : %BUILD_DIR%
echo - Dist : %DIST_DIR%
echo.
echo [1/5] Packing Assets...
python pack_assets.py
if %ERRORLEVEL% NEQ 0 (
echo [Error] Failed to pack assets.
pause
exit /b %ERRORLEVEL%
)
echo.
echo [Cleaning] Removing old build directory...
if exist "%BUILD_DIR%" rmdir /s /q "%BUILD_DIR%"
echo.
echo [2/5] Configuring CMake (Release)...
REM Explicitly point to the SOURCE DIRECTORY, not the file
cmake -S "%SOURCE_DIR%" -B "%BUILD_DIR%" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
if %ERRORLEVEL% NEQ 0 (
echo [Error] CMake configuration failed.
pause
exit /b %ERRORLEVEL%
)
echo.
echo [3/5] Building Project...
cmake --build "%BUILD_DIR%" --config Release
if %ERRORLEVEL% NEQ 0 (
echo [Error] Build failed.
pause
exit /b %ERRORLEVEL%
)
echo.
echo [4/5] Creating Distribution...
if exist "%DIST_DIR%" rmdir /s /q "%DIST_DIR%"
mkdir "%DIST_DIR%"
REM Copy icon for installer
if exist "resources\logo.ico" (
copy /Y "resources\logo.ico" "%DIST_DIR%\" > nul
echo + Copied logo.ico
)
if exist "%BUILD_DIR%\FileEcho.exe" (
copy /Y "%BUILD_DIR%\FileEcho.exe" "%DIST_DIR%\" > nul
echo + Copied FileEcho.exe
) else (
echo [Error] FileEcho.exe not found.
pause
exit /b 1
)
echo.
echo (Static linking enabled - no DLL dependencies)
echo.
echo ========================================================
echo Build Complete! FileEcho v%VERSION%
echo Output: %DIST_DIR%\
echo ========================================================
echo.
echo To create installer: makensis installer.nsi
echo.
pause