-
Notifications
You must be signed in to change notification settings - Fork 14
/
buf.mk
69 lines (56 loc) · 1.64 KB
/
buf.mk
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
69
# Managed by makego. DO NOT EDIT.
# Must be set
$(call _assert_var,MAKEGO)
$(call _conditional_include,$(MAKEGO)/base.mk)
$(call _conditional_include,make/go/dep_buf.mk)
# Settable
BUF_LINT_INPUT ?=
# Settable
BUF_BREAKING_INPUT ?=
# Settable
BUF_BREAKING_AGAINST_INPUT ?=
# Settable
BUF_FORMAT_INPUT ?=
.PHONY: bufgeneratedeps
bufgeneratedeps:: $(BUF)
.PHONY: bufgenerateclean
bufgenerateclean::
.PHONY: bufgeneratesteps
bufgeneratesteps::
.PHONY: bufgenerate
bufgenerate:
@echo make bufgeneratedeps
@$(MAKE) bufgeneratedeps
ifneq ($(BUF_FORMAT_INPUT),)
@echo buf format -w $(BUF_FORMAT_INPUT)
@$(BUF_BIN) format -w $(BUF_FORMAT_INPUT)
endif
@echo make bufgenerateclean
@$(MAKE) bufgenerateclean
@echo make bufgeneratesteps
@$(MAKE) bufgeneratesteps
pregenerate:: bufgenerate
.PHONY: buflintdeps
buflintdeps:: $(BUF)
ifneq ($(BUF_LINT_INPUT),)
.PHONY: buflint
buflint:
@echo make buflintdeps
@$(MAKE) buflintdeps
@echo buf lint $(BUF_LINT_INPUT)
@$(BUF_BIN) lint $(BUF_LINT_INPUT)
postlint:: buflint
endif
ifneq ($(BUF_BREAKING_INPUT),)
ifneq ($(BUF_BREAKING_AGAINST_INPUT),)
.PHONY: bufbreaking
bufbreaking: $(BUF)
@echo buf breaking $(BUF_BREAKING_INPUT) --against $(BUF_BREAKING_AGAINST_INPUT)
@$(BUF_BIN) breaking $(BUF_BREAKING_INPUT) --against $(BUF_BREAKING_AGAINST_INPUT)
postlint:: bufbreaking
endif
endif
.PHONY: updatebufversion
updatebufversion:
$(SED_I) -E "s/BUF_VERSION \?=.*/BUF_VERSION ?= v${RELEASE_BUF_VERSION}/" "make/go/dep_buf.mk"
$(SED_I) -E "s/\# https\:\/\/github.com\/bufbuild\/buf\/releases.*/\# https\:\/\/github.com\/bufbuild\/buf\/releases $(shell date "+%Y%m%d") checked $(shell date "+%Y%m%d")/" "make/go/dep_buf.mk"