-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (39 loc) · 944 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
export GOBIN := $(PWD)/bin
export PATH := $(GOBIN):$(PATH)
TOOLS=$(shell cat tools/tools.go | egrep '^\s_ ' | awk '{ print $$2 }')
.PHONY: bootstrap-tools
bootstrap-tools:
@echo "Installing: " $(TOOLS)
@go install $(TOOLS)
.PHONY: run
run:
go run cmd/server/main.go
.PHONY: lint
lint:
$(GOBIN)/golangci-lint run -v ./...
.PHONY: lint-fix
lint-fix:
$(GOBIN)/golangci-lint run --fix -v ./...
.PHONY: test
test:
go test -v -race ./...
.PHONY: cover
cover:
go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./...
.PHONY: tidy
tidy:
go mod tidy
.PHONY: build-proto
build-proto:
protoc \
--go_out=. \
--go_opt=paths=source_relative \
--go-grpc_out=. \
--go-grpc_opt=paths=source_relative \
pluginapi/plugin.proto
.PHONY: build-example-plugin
build-example-plugin:
@for dir in $(shell ls plugins); do \
echo "Build: plugins/$${dir}"; \
go build -o plugins/$${dir}/$${dir} plugins/$${dir}/main.go; \
done