cmd, Makefile: add initial build structure
This adds Makefile and cmd/protoc-gen-gogoctrd for generating protobufs. More adjustments are required and the default target has been stubbed out for now. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
fdbae36237
commit
ab088af2a6
2 changed files with 163 additions and 0 deletions
27
cmd/protoc-gen-gogoctrd/main.go
Normal file
27
cmd/protoc-gen-gogoctrd/main.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
||||
"github.com/gogo/protobuf/vanity"
|
||||
"github.com/gogo/protobuf/vanity/command"
|
||||
)
|
||||
|
||||
func main() {
|
||||
req := command.Read()
|
||||
files := req.GetProtoFile()
|
||||
files = vanity.FilterFiles(files, vanity.NotGoogleProtobufDescriptorProto)
|
||||
for _, opt := range []func(*descriptor.FileDescriptorProto){
|
||||
vanity.TurnOnGoStringAll,
|
||||
vanity.TurnOffGoGettersAll,
|
||||
vanity.TurnOffGoStringerAll,
|
||||
vanity.TurnOnMarshalerAll,
|
||||
vanity.TurnOnStringerAll,
|
||||
vanity.TurnOnUnmarshalerAll,
|
||||
vanity.TurnOnSizerAll,
|
||||
} {
|
||||
vanity.ForEachFile(files, opt)
|
||||
}
|
||||
|
||||
resp := command.Generate(req)
|
||||
command.Write(resp)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue