File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
samples/snippets/src/main/resources/com/example/spanner Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ #### To generate SingerProto.java and descriptors.pb file from singer.proto using ` protoc `
2+ ``` shell
3+ cd samples/snippets/src/main/resources/
4+ protoc --proto_path=com/example/spanner/ --include_imports --descriptor_set_out=com/example/spanner/descriptors.pb
5+ --java_out=. com/example/spanner/singer.proto
6+ ```
Original file line number Diff line number Diff line change 1+ syntax = "proto3" ;
2+
3+ package examples.spanner.music ;
4+
5+ option java_package = "com.example.spanner" ;
6+ option java_outer_classname = "SingerProto" ;
7+ option java_multiple_files = false ;
8+
9+ message SingerInfo {
10+ optional int64 singer_id = 1 ;
11+ optional string birth_date = 2 ;
12+ optional string nationality = 3 ;
13+ optional Genre genre = 4 ;
14+ }
15+
16+ enum Genre {
17+ POP = 0 ;
18+ JAZZ = 1 ;
19+ FOLK = 2 ;
20+ ROCK = 3 ;
21+ }
You can’t perform that action at this time.
0 commit comments