Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gogo support #66

Merged
merged 16 commits into from
Mar 27, 2018
29 changes: 28 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# protoc-gen-go parameters for properly generating the import path for PGV
VALIDATE_IMPORT="Mvalidate/validate.proto=github.com/lyft/protoc-gen-validate/validate"
VALIDATE_IMPORT := Mvalidate/validate.proto=github.com/lyft/protoc-gen-validate/validate

# protoc-gen-gogo parameters
GOGO_IMPORT_SPACES := ${VALIDATE_IMPORT},\
Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/types,\
Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto
empty :=
space := $(empty) $(empty)
GOGO_IMPORT:=$(subst $(space),,$(GOGO_IMPORT_SPACES))

.PHONY: build
build: validate/validate.pb.go
Expand Down Expand Up @@ -68,6 +81,20 @@ kitchensink:
`find . -name "*.proto"`
cd tests/kitchensink/go && go build .

.PHONY: kitchensink-gogo
kitchensink-gogo:
# generates the kitchensink gogo files
rm -r tests/kitchensink/gogo || true
mkdir -p tests/kitchensink/gogo
cd tests/kitchensink && \
protoc \
-I . \
-I ../.. \
--gogofast_out="${GOGO_IMPORT}:./gogo" \
--validate_out="lang=gogo:./gogo" \
`find . -name "*.proto"`
cd tests/kitchensink/gogo && go build .

.PHONY: testcases
testcases:
# generate the test harness case protos
Expand Down
Loading