-
Notifications
You must be signed in to change notification settings - Fork 3
/
make.bat
88 lines (71 loc) · 1.89 KB
/
make.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
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
@echo OFF
set "args=%*"
pushd "%~dp0"
setlocal ENABLEDELAYEDEXPANSION
set GOPATH="%~dp0vendor"
rem Set the GOPROXY environment variable
Set GOPROXY=https://goproxy.io,direct
rem set http_proxy=socks5://127.0.0.1:1080
rem set https_proxy=%http_proxy%
if /i "%args%"=="default" goto %args%
if /i "%args%"=="static-server" goto %args%
if /i "%args%"=="deps" goto %args%
if /i "%args%"=="fmt" goto %args%
if /i "%args%"=="server" goto %args%
if /i "%args%"=="static-release-all" goto %args%
if /i "%args%"=="release-all" goto %args%
if /i "%args%"=="all" goto %args%
if /i "%args%"=="static-all" goto %args%
if /i "%args%"=="run" goto %args%
if /i "%args%"=="test" goto %args%
if /i "%BUILDTAGS%"=="" (Set BUILDTAGS=release)
goto default
:default
CALL :all
GOTO :EOF
:deps
CALL go mod tidy -v
rem CALL go mod vendor -v
GOTO :EOF
:fmt
CALL go fmt -mod=mod ./...
GOTO :EOF
:static-server
Set CGO_ENABLED=0
CALL go install --tags "%BUILDTAGS%" -ldflags "-s -w -extldflags ""-static""" -mod=mod github.com/larisgo/laravel-echo-server/main/laravel-echo-server
GOTO :EOF
:server
CALL go install --tags "%BUILDTAGS%" -ldflags "-s -w" -mod=mod github.com/larisgo/laravel-echo-server/main/laravel-echo-server
GOTO :EOF
:release
Set BUILDTAGS=release
GOTO :EOF
:static-release-all
CALL :fmt
CALL :release
CALL :static-server
GOTO :EOF
:release-all
CALL :fmt
CALL :release
CALL :server
GOTO :EOF
:all
CALL :fmt
CALL :server
GOTO :EOF
:static-all
CALL :fmt
CALL :static-server
GOTO :EOF
:clean
CALL go clean -mod=mod -r ./...
:run
Set GOOS=
Set GOARCH=
CALL go install -mod=mod -race github.com/larisgo/laravel-echo-server/main/laravel-echo-server
CALL "vendor\bin\laravel-echo-server.exe"
:test
CALL go clean -testcache
CALL go test -race -cover -covermode=atomic -mod=mod ./...
GOTO :EOF