diff --git a/.gitignore b/.gitignore index daf913b..56b7452 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +/test/output/ + # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a diff --git a/encoder.go b/encoder.go index ef7b7b5..c8b1b84 100644 --- a/encoder.go +++ b/encoder.go @@ -19,6 +19,8 @@ func NewGenericTemplateBasedEncoder(service *descriptor.ServiceDescriptorProto, } func (e *GenericTemplateBasedEncoder) Files() []*plugin_go.CodeGeneratorResponse_File { + //log.Printf("file: %v\n", e.file) + //log.Printf("service: %v\n", e.service) var content string = "hello world" var fileName string = "test.txt" return []*plugin_go.CodeGeneratorResponse_File{ diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..aa0fea8 --- /dev/null +++ b/test/Makefile @@ -0,0 +1,4 @@ +.PHONY: build +build: + mkdir -p output + protoc -I. --gotemplate_out=output *.proto diff --git a/test/dummy.proto b/test/dummy.proto new file mode 100644 index 0000000..c7ab48f --- /dev/null +++ b/test/dummy.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package dummy; + +message Dummy1 { + float aaa = 1; + string bbb = 2; + int32 ccc = 3; + int64 ddd = 4; + repeated string eee = 5; +} + +message Dummy2 { + float fff = 1; + Dummy1 ggg = 2; +} + +message Dummy3 {} + +service DummyService { + rpc Hhh(Dummy1) returns (Dummy2) {} + rpc Iii(Dummy2) returns (Dummy1) {} +} + +/* +service DummyService2 { + rpc Jjj(Dummy2) returns (Dummy2) {} +} + +service DummyService3 { +} +*/ \ No newline at end of file