-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.bat
More file actions
69 lines (56 loc) · 1.67 KB
/
build.bat
File metadata and controls
69 lines (56 loc) · 1.67 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
@echo off
REM Unified build script for Noviq (Windows CMD)
if not exist libs mkdir libs
if "%1"=="--release" goto release
if "%1"=="--snapshot" goto snapshot
if "%1"=="" goto debug
goto usage
:debug
echo Building Noviq (Debug)...
cargo build
if errorlevel 1 exit /b 1
for /f "tokens=2" %%i in ('target\debug\noviq.exe ^| findstr "Version:"') do set VERSION=%%i
set OUTPUT_NAME=noviq-%VERSION%-windows-x86_64.exe
copy target\debug\noviq.exe libs\%OUTPUT_NAME% >nul
echo.
echo Debug build complete!
echo Binary copied to: libs\%OUTPUT_NAME%
echo.
target\debug\noviq.exe
goto end
:release
echo Building Noviq (Release)...
cargo build --release
if errorlevel 1 exit /b 1
for /f "tokens=2" %%i in ('target\release\noviq.exe ^| findstr "Version:"') do set VERSION=%%i
set OUTPUT_NAME=noviq-%VERSION%-windows-x86_64.exe
copy target\release\noviq.exe libs\%OUTPUT_NAME% >nul
echo.
echo Release build complete!
echo Binary copied to: libs\%OUTPUT_NAME%
echo.
target\release\noviq.exe
goto end
:snapshot
echo Building Noviq (Snapshot)...
set SNAPSHOT=1
cargo build --profile snapshot
if errorlevel 1 exit /b 1
for /f "tokens=2" %%i in ('target\snapshot\noviq.exe ^| findstr "Version:"') do set VERSION=%%i
set OUTPUT_NAME=noviq-%VERSION%-windows-x86_64.exe
copy target\snapshot\noviq.exe libs\%OUTPUT_NAME% >nul
echo.
echo Snapshot build complete!
echo Binary copied to: libs\%OUTPUT_NAME%
echo.
target\snapshot\noviq.exe
goto end
:usage
echo Usage: build.bat [--release^|--snapshot]
echo.
echo Options:
echo (no flag) Build in debug mode with snapshot version
echo --release Build optimized release with clean version
echo --snapshot Build optimized snapshot with dated version
exit /b 1
:end