-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (58 loc) · 1.54 KB
/
Copy pathMakefile
File metadata and controls
68 lines (58 loc) · 1.54 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
VERSION=$(shell git describe --tags --always)
API_PROTO_FILES=$(shell find api -name *.proto)
.PHONY: init
# init env
init:
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
go install github.com/envoyproxy/protoc-gen-validate@latest
go install github.com/go-kratos/kratos/cmd/protoc-gen-go-errors/v2@latest
go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest
go install github.com/google/wire/cmd/wire@latest
go install github.com/vektra/mockery/v2@v2.20.0
go install entgo.io/ent/cmd/ent@v0.11.4
go install github.com/bufbuild/buf/cmd/buf@v1.10.0
.PHONY: api
# generate api proto
api:
make -C ./app/controlplane api
make -C ./app/cli api
make -C ./app/artifact-cas api
.PHONY: generate
# generate
generate:
go generate ./...
.PHONY: all
# generate all
all:
make generate;
make api;
.PHONY: lint
# run linter
lint:
golangci-lint run
buf lint
make -C ./app/controlplane lint
make -C ./app/cli lint
make -C ./app/artifact-cas lint
.PHONY: test
# All tests, both unit and integration
test:
go test ./...
# show help
help:
@echo ''
@echo 'Usage:'
@echo ' make [target]'
@echo ''
@echo 'Targets:'
@awk '/^[a-zA-Z\-_0-9]+:/ { \
helpMessage = match(lastLine, /^# (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \
printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help