-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (41 loc) · 1.05 KB
/
Makefile
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
WORKDIR=`pwd`
Project=lava
Base=github.com/pubgo/funk
Version=$(shell git tag --sort=committerdate | tail -n 1)
BuildTime=$(shell date "+%F %T")
CommitID=$(shell git rev-parse --short=8 HEAD)
GOPATH=$(shell go env GOPATH )
LDFLAGS=-ldflags " \
-X '${Base}/version.buildTime=${BuildTime}' \
-X '${Base}/version.commitID=${CommitID}' \
-X '${Base}/version.version=${Version:-"v0.0.1-dev"}' \
-X '${Base}/version.project=${Project}' \
"
.PHONY: test
test:
@go test -short -race -v ./... -cover
.PHONY: cover
cover:
gocov test -tags "kcp quic" ./... | gocov-html > cover.html
open cover.html
.PHONY: vet
vet:
@go vet ./...
.PHONY: generate
generate:
@go generate ./...
.PHONY: deps
deps:
# https://github.com/protocolbuffers/protobuf
@go install -v github.com/tinylib/msgp
@go install -v github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2
.PHONY: protobuf
protobuf:
protobuild vendor
protobuild gen
.PHONY: lint
lint:
golangci-lint --version
golangci-lint run --timeout 3m --verbose ./...
install-protoc:
go install -v ./cmds/protoc-gen-lava