forked from ZacxDev/protoc-gen-struct-transformer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (33 loc) · 1.48 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
VERSION=1.0.7-dev
BUILDTIME=$(shell date +"%Y-%m-%dT%T%z")
LDFLAGS= -ldflags '-X github.com/innovation-upstream/protoc-gen-struct-transformer/generator.version=$(VERSION) -X github.com/innovation-upstream/protoc-gen-struct-transformer/generator.buildTime=$(BUILDTIME)'
.PHONY: re-generate-example generate install build version setup
re-generate-example:
protoc \
--proto_path=$(GOPATH)/pkg/mod/github.com/gogo:. \
--struct-transformer_out=package=transform,debug=false,helper-package=helpers,goimports=true:. \
--gogofaster_out=Moptions/annotations.proto=github.com/innovation-upstream/protoc-gen-struct-transformer/options:. \
./example/message.proto
generate: version re-generate-example
re-generate-example-debug:
protoc \
--proto_path=$(GOPATH)/pkg/mod/github.com/gogo:. \
--struct-transformer_out=package=transform,debug=true,helper-package=helpers,goimports=true:. \
--gogofaster_out=Moptions/annotations.proto=github.com/innovation-upstream/protoc-gen-struct-transformer/options:. \
./example/message.proto
generate-debug: version re-generate-example-debug
generate-annotations:
protoc \
--proto_path=$(GOPATH)/pkg/mod/github.com/gogo:. \
--gogofaster_out=Moptions/annotations.proto=github.com/innovation-upstream/protoc-gen-struct-transformer/options:. \
./options/annotations.proto
install: setup
go install $(LDFLAGS)
build: OUTPUT=.
build: setup
go build $(LDFLAGS) -o $(OUTPUT)
version:
protoc-gen-struct-transformer --version
setup:
go mod download
go mod verify