mage: run code generators
This commit is contained in:
parent
d2840f3328
commit
eb5d770c45
11
mage.go
11
mage.go
|
@ -164,9 +164,20 @@ func Tools(ctx context.Context) {
|
||||||
tools := []string{
|
tools := []string{
|
||||||
"github.com/golang/dep/cmd/dep",
|
"github.com/golang/dep/cmd/dep",
|
||||||
"github.com/golang/protobuf/protoc-gen-go",
|
"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 {
|
for _, t := range tools {
|
||||||
shouldWork(ctx, nil, wd, "go", "get", "-u", t)
|
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")
|
||||||
|
}
|
||||||
|
|
|
@ -5,15 +5,3 @@ protoc -I/usr/local/include -I. \
|
||||||
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
|
-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:. \
|
--go_out=Mgoogle/api/annotations.proto=github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api,plugins=grpc:. \
|
||||||
route.proto
|
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
|
|
||||||
|
|
Loading…
Reference in New Issue