-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (24 loc) · 945 Bytes
/
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
.PHONY: build bench-redis-mq
PROJECT_PATH=$(shell pwd)
GO_TEST_CMD=$(if $(shell which richgo),richgo test,go test)
REPO=github.com/j75689/Tmaster
VERSION=$(shell git describe --tags)
GIT_COMMIT=$(shell git rev-parse HEAD)
GIT_COMMIT_DATE=$(shell git log -n1 --pretty='format:%cd' --date=format:'%Y-%m-%d_%H:%M:%S')
tools:
@go get github.com/google/wire/cmd/wire
@go install github.com/golang/mock/[email protected]
gen:
# generate model & reslover
@go run tool/gqlgen/main.go
# generate dependency injection
@wire ./service/...
mock-gen:
@mockgen -package=mock -destination=./mock/mock_gen.go github.com/j75689/Tmaster/pkg/mq MQ
build:
@go build -ldflags="-X ${REPO}/cmd.version=${VERSION} -X ${REPO}/cmd.commitID=${GIT_COMMIT} -X ${REPO}/cmd.commitDate=${GIT_COMMIT_DATE}"
build-image:
@./build/build.sh
# bench
bench-redis-mq:
$(GO_TEST_CMD) -run=none -bench=. -benchmem -benchtime=1s -v $(PROJECT_PATH)/pkg/mq/redis_stream/*.go