-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
46 lines (39 loc) · 1.24 KB
/
build.bat
File metadata and controls
46 lines (39 loc) · 1.24 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
@echo off
REM Build script for Windows
REM This script builds executables for Windows and Linux
set APP_NAME=dbx
set BUILD_DIR=dist
echo ========================================
echo DBX Build Script for Windows
echo ========================================
echo.
REM Create build directory if it doesn't exist
if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"
echo [1/3] Building Windows executable (amd64)...
set GOOS=windows
set GOARCH=amd64
go build -ldflags "-s -w" -o %BUILD_DIR%\%APP_NAME%-windows-amd64.exe main.go
if %ERRORLEVEL% NEQ 0 (
echo ERROR: Windows build failed!
exit /b 1
)
echo ✓ Windows build complete: %BUILD_DIR%\%APP_NAME%-windows-amd64.exe
echo.
echo [2/3] Building Linux executable (amd64)...
set GOOS=linux
set GOARCH=amd64
go build -ldflags "-s -w" -o %BUILD_DIR%\%APP_NAME%-linux-amd64 main.go
if %ERRORLEVEL% NEQ 0 (
echo ERROR: Linux build failed!
exit /b 1
)
echo ✓ Linux build complete: %BUILD_DIR%\%APP_NAME%-linux-amd64
echo.
echo [3/3] Build Summary:
echo - Windows: %BUILD_DIR%\%APP_NAME%-windows-amd64.exe
echo - Linux: %BUILD_DIR%\%APP_NAME%-linux-amd64
echo.
echo ========================================
echo All builds completed successfully!
echo ========================================
pause