From eb5d770c4564831213d995c2544ed0a63e688f3a Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sat, 20 Jan 2018 08:32:47 -0800 Subject: [PATCH] mage: run code generators --- mage.go | 11 +++++++++++ proto/regen.sh | 12 ------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/mage.go b/mage.go index ff8cf4b..b5d0cc2 100644 --- a/mage.go +++ b/mage.go @@ -164,9 +164,20 @@ func Tools(ctx context.Context) { tools := []string{ "github.com/golang/dep/cmd/dep", "github.com/golang/protobuf/protoc-gen-go", + // "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway", + // "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger", } for _, t := range tools { shouldWork(ctx, nil, wd, "go", "get", "-u", t) } } + +// Generate runs code generators and the like. +func Generate(ctx context.Context) { + dir := filepath.Join(wd, "proto") + + Tools(ctx) + + shouldWork(ctx, nil, dir, "sh", "./regen.sh") +} diff --git a/proto/regen.sh b/proto/regen.sh index 4989a1d..fdc1a10 100755 --- a/proto/regen.sh +++ b/proto/regen.sh @@ -5,15 +5,3 @@ protoc -I/usr/local/include -I. \ -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ --go_out=Mgoogle/api/annotations.proto=github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api,plugins=grpc:. \ route.proto - -# protoc -I/usr/local/include -I. \ -# -I$GOPATH/src \ -# -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ -# --grpc-gateway_out=logtostderr=true:. \ -# route.proto - -# protoc -I/usr/local/include -I. \ -# -I$GOPATH/src \ -# -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ -# --swagger_out=logtostderr=true:. \ -# route.proto