35
35
// A proto file used to test the "custom options" feature of proto2.
38
// Some generic_services option(s) added automatically.
39
// See: http://go/proto2-generic-services-default
40
option cc_generic_services = true; // auto-added
41
option java_generic_services = true; // auto-added
42
option py_generic_services = true;
38
44
// A custom file option (defined below).
39
45
option (file_opt1) = 9876543210;
273
279
option (complex_opt3).complexoptiontype5.plugh = 22;
274
280
option (complexopt6).xyzzy = 24;
283
// ------------------------------------------------------
284
// Definitions for testing aggregate option parsing.
285
// See descriptor_unittest.cc.
287
message AggregateMessageSet {
288
option message_set_wire_format = true;
292
message AggregateMessageSetElement {
293
extend AggregateMessageSet {
294
optional AggregateMessageSetElement message_set_extension = 15447542;
296
optional string s = 1;
299
// A helper type used to test aggregate option parsing
301
optional int32 i = 1;
302
optional string s = 2;
305
optional Aggregate sub = 3;
307
// To test the parsing of extensions inside aggregate values
308
optional google.protobuf.FileOptions file = 4;
309
extend google.protobuf.FileOptions {
310
optional Aggregate nested = 15476903;
313
// An embedded message set
314
optional AggregateMessageSet mset = 5;
317
// Allow Aggregate to be used as an option at all possible locations
318
// in the .proto grammer.
319
extend google.protobuf.FileOptions { optional Aggregate fileopt = 15478479; }
320
extend google.protobuf.MessageOptions { optional Aggregate msgopt = 15480088; }
321
extend google.protobuf.FieldOptions { optional Aggregate fieldopt = 15481374; }
322
extend google.protobuf.EnumOptions { optional Aggregate enumopt = 15483218; }
323
extend google.protobuf.EnumValueOptions { optional Aggregate enumvalopt = 15486921; }
324
extend google.protobuf.ServiceOptions { optional Aggregate serviceopt = 15497145; }
325
extend google.protobuf.MethodOptions { optional Aggregate methodopt = 15512713; }
327
// Try using AggregateOption at different points in the proto grammar
330
// Also test the handling of comments
331
/* of both types */ i: 100
333
sub { s: 'NestedFileAnnotation' }
335
// Include a google.protobuf.FileOptions and recursively extend it with
338
[protobuf_unittest.fileopt] {
339
s:'FileExtensionAnnotation'
343
// A message set inside an option value
345
[protobuf_unittest.AggregateMessageSetElement.message_set_extension] {
346
s: 'EmbeddedMessageSetElement'
351
message AggregateMessage {
352
option (msgopt) = { i:101 s:'MessageAnnotation' };
353
optional int32 fieldname = 1 [(fieldopt) = { s:'FieldAnnotation' }];
356
service AggregateService {
357
option (serviceopt) = { s:'ServiceAnnotation' };
358
rpc Method (AggregateMessage) returns (AggregateMessage) {
359
option (methodopt) = { s:'MethodAnnotation' };
364
option (enumopt) = { s:'EnumAnnotation' };
365
VALUE = 1 [(enumvalopt) = { s:'EnumValueAnnotation' }];