-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
48 lines (41 loc) · 799 Bytes
/
build.bat
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
@echo off
if "%1%"=="clean" goto CLEAN
if "%1%"=="build" goto BUILD
if "%1%"=="prod" goto PROD
goto BUILD
:CLEAN
ninja -C driver/build-debug clean
ninja -C driver/build-release clean
del static\dist\*.js
cd server
go clean
cd ..
goto EXIT
:BUILD
ninja -C driver/build-debug driver install
call npm run --prefix static build
cd server
set GOOS=windows
set GOARCH=amd64
set CGO_ENABLED=1
echo building server...
go clean
go build -tags debug
cd ..
goto EXIT
:PROD
ninja -C driver/build-release driver install
call npm run --prefix static build-prod
cp -r static/dist server/server
cd server
set GOOS=windows
set GOARCH=amd64
set CGO_ENABLED=1
echo building production server...
go clean
go build -tags release -ldflags "-s -w"
cd ..
rmdir /Q /S .\server\server\dist\
goto EXIT
:EXIT
echo done!