-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
46 lines (34 loc) · 1.11 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
SHELL:=/bin/bash
ifdef test_run
TEST_ARGS := -run $(test_run)
endif
changelog_args=-o CHANGELOG.md --tag-filter-pattern '^v'
test_command=richgo test ./... $(TEST_ARGS) -v --cover
proto:
@protoc --go_out=plugins=grpc:. pb/example/*.proto
@ls pb/example/*.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}'
create-version:
ifndef version
$(error version is not set)
endif
@echo -e 'package config\n\n// Version define version of fer' >config/version.go
@echo 'const Version = "$(version)"' >>config/version.go
run:
@go run main.go
build:
@go build -o ./bin/fer
changelog: fetch-git create-changelog create-version
fetch-git:
@echo 'fetching remote'
@git fetch
create-changelog:
ifndef version
$(error version is not set)
endif
$(eval changelog_args=--next-tag $(version) $(changelog_args))
git-chglog $(changelog_args)
lint:
golangci-lint run --print-issued-lines=false --exclude-use-default=false --enable=golint --enable=goimports --enable=unconvert --enable=unparam --concurrency=2
test:
$(test_command)
.PHONY: test lint create-changelog create-version build fetch-git run proto