-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
68 lines (55 loc) · 1.33 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
IMAGE=complex64/protoc-gen-gorm
all: lint test
build:
go build ./...
# Run all tests.
t :test
test:
go test ./...
# Build containerized `protoc-gen-gorm`.
docker:
docker build -t "${IMAGE}:latest" .
# Build and run the aggregated linker.
l: lint
lint: build
golangci-lint run
# Lint the .proto files with buf.
b: buf
buf:
cd proto && buf lint
cd internal/gengorm/test && buf lint
cd internal/require && buf lint
# Assumes $GOPATH/bin is in your $PATH!
gen: generate
generate: gormpb install
# Files used by tests of the plugin implementation.
cd internal/gengorm/test && buf generate
# Remove code generated from tests.
find proto -name '*.go' -delete
# Files used by tests of the internal packages.
cd internal/require && buf generate
# Generated examples
cd examples/buf && go generate
cd examples/grpc && go generate
cd examples/protoc && go generate
.PHONY: gormpb
gormpb:
# Generate the standalone module and update/lock dependencies.
cd proto && buf generate
find proto -type f -name "*.pb.go" -exec mv {} gormpb \;
cd gormpb && go mod tidy
# Install `protoc-gen-go` into $GOPATH/bin.
i: install
install:
go install
# Remove all generated files.
clean:
go clean
find -name '*.pb.go' -delete
$(MAKE) gormpb
p: proto
.PHONY: proto
proto:
buf lint proto
cd internal/gengorm/test && buf lint
cd internal/require && buf lint