-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (45 loc) · 1.3 KB
/
Makefile
File metadata and controls
60 lines (45 loc) · 1.3 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
# Copyright (c) Microsoft Corporation.
# Licensed under the Apache v2.0 license.
GOCMD=GO111MODULE=on GOARCH=amd64 go
GOBUILD=$(GOCMD) build -v #-mod=vendor
GOTEST=$(GOCMD) test -v
GOHOSTOS=$(strip $(shell $(GOCMD) env get GOHOSTOS))
MOCKGEN=$(shell command -v mockgen 2> /dev/null)
GOPATH_BIN := $(shell go env GOPATH)/bin
# Private repo workaround
export GOPRIVATE = github.com/microsoft
# Active module mode, as we use go modules to manage dependencies
export GO111MODULE=on
#
PKG :=
all: format test
.PHONY: tidy
tidy:
-go mod tidy -e
format:
gofmt -s -w rpc/ pkg/
bootstrap:
GOOS="linux" go get -u google.golang.org/grpc@v1.59.0
GOOS="linux" go install github.com/golang/protobuf/protoc-gen-go@v1.3.2
test: unittest
unittest:
$(GOTEST) ./pkg/...
generate: bootstrap
(./gen.sh)
pipeline: bootstrap
(./gen.sh -c)
## Install mockgen golang bin
install-mockgen:
ifeq ($(MOCKGEN),)
go install github.com/golang/mock/mockgen@v1.6.0
endif
MOCKGEN=$(shell command -v mockgen 2> /dev/null)
mocks:
go mod download github.com/golang/mock
go get github.com/golang/mock@v1.6.0
go generate ./...
golangci-lint: tidy
rm -f $(GOPATH_BIN)/golangci-lint
$(GOCMD) clean -cache
$(GOCMD) install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
$(GOPATH_BIN)/golangci-lint run --config .golangci.yml