mage: run code generators

This commit is contained in:
Cadey Ratio 2018-01-20 08:32:47 -08:00
parent d2840f3328
commit eb5d770c45
2 changed files with 11 additions and 12 deletions

11
mage.go
View File

@ -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")
}

View File

@ -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