-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
37 lines (29 loc) · 884 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
include tools/tools.mk
PROTOVALIDATE_MODULE := "buf.build/bufbuild/protovalidate"
PROTOS_DIR := "protos"
GENERATED_DIR := "gen"
TEST_DIR := "internal/test"
TESTDATA_DIR := "$(TEST_DIR)/testdata"
.PHONY: build
build: deps lint test compile install
.PHONY: compile
compile:
@ go build -o bin/protoc-gen-jsonschema cmd/protoc-gen-jsonschema/main.go
.PHONY: deps
deps:
@ go mod tidy --compat=1.21
.PHONY: install
install:
@ go install ./cmd/protoc-gen-jsonschema
.PHONY: lint
lint: $(BUF) $(GOLANGCI_LINT)
@ $(GOLANGCI_LINT) run --config=.golangci.yaml --fix
@ $(BUF) format -w
.PHONY: test
test: $(GOTESTSUM)
@ CGO_ENABLED=0 $(GOTESTSUM) -- -tags=tests ./...
# Run after testproto package is modified to generate new testdata
.PHONY: generate-testdata
generate-testdata: $(BUF)
@ rm -rf $(TESTDATA_DIR)/code_generator_request.pb.bin
@ cd $(TEST_DIR) && $(BUF) generate .