-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (41 loc) · 1.07 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
SHELL=/usr/bin/env bash
# Project specific properties.
application_name = rosen
application_binary_name = rosen
# For ProtoBuf code generation.
proto_path=src/proto/*.proto
# Builds the project.
build:
@echo "+$@"
@go build -o bin/$(application_binary_name)
# Runs the project after linting and building it anew.
run: tidy lint build
@echo "+$@"
@echo "########### Running the application binary ############"
@bin/$(application_binary_name)
# Runs the project.
run-only:
@echo "+$@"
@echo "########### Running the application binary ############"
@bin/$(application_binary_name)
# Tests the whole project.
test:
@echo "+$@"
@CGO_ENABLED=1 go test -race -coverprofile=coverage.out -covermode=atomic ./...
# Runs the "go mod tidy" command.
tidy:
@echo "+$@"
@go mod tidy
# Runs golang-ci-lint over the project.
lint:
@echo "+$@"
@golangci-lint run
# Generates code using the found protocol buffer files.
proto:
@echo "+$@"
@protoc \
--go_out=. \
--go_opt=paths=source_relative \
--go-grpc_out=. \
--go-grpc_opt=paths=source_relative \
$(proto_path)