Skip to content

Commit

Permalink
Preserve Package (#15)
Browse files Browse the repository at this point in the history
* preserve package

* bump version
  • Loading branch information
alpancs authored Nov 8, 2021
1 parent 6651aa2 commit a6e79ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions content_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ func (b *contentBuilder) build(protoFile *descriptorpb.FileDescriptorProto) (str
compVersion := b.request.GetCompilerVersion()
fmt.Fprintf(b.output, "// Code generated by protoc-gen-pubsub-schema. DO NOT EDIT.\n")
fmt.Fprintf(b.output, "// versions:\n")
fmt.Fprintf(b.output, "// protoc-gen-pubsub-schema v1.4.4\n")
fmt.Fprintf(b.output, "// protoc-gen-pubsub-schema v1.5.0\n")
fmt.Fprintf(b.output, "// protoc v%d.%d.%d%s\n", compVersion.GetMajor(), compVersion.GetMinor(), compVersion.GetPatch(), compVersion.GetSuffix())
fmt.Fprintf(b.output, "// source: %s\n\n", protoFile.GetName())
fmt.Fprintf(b.output, "syntax = \"%s\";\n", b.schemaSyntax)
fmt.Fprintf(b.output, "syntax = \"%s\";\n\n", b.schemaSyntax)
fmt.Fprintf(b.output, "package %s;\n", protoFile.GetPackage())
b.buildMessages(protoFile.GetMessageType(), 0)
b.buildEnums(protoFile.GetEnumType(), 0)
return b.output.String(), nil
Expand Down
4 changes: 3 additions & 1 deletion example/user_add_comment.pps
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// Code generated by protoc-gen-pubsub-schema. DO NOT EDIT.
// versions:
// protoc-gen-pubsub-schema v1.4.4
// protoc-gen-pubsub-schema v1.5.0
// protoc v3.19.1
// source: example/user_add_comment.proto

syntax = "proto2";

package example;

message UserAddComment {
required User user = 1;
required string comment = 2;
Expand Down

0 comments on commit a6e79ed

Please sign in to comment.