OLD | NEW |
---|---|
1 // Experimental options controlling Dart code generation. | 1 // Experimental options controlling Dart code generation. |
2 syntax = "proto2"; | 2 syntax = "proto2"; |
3 | 3 |
4 package dart_options; | 4 package dart_options; |
5 | 5 |
6 // This file must be modified for google internal use, | 6 // This file must be modified for google internal use, |
7 // because custom options only work when the package name | 7 // because custom options only work when the package name |
8 // agrees with the version of protoc we are using. | 8 // agrees with the version of protoc we are using. |
9 // (The import statement and "google.protobuf." prefix need to be changed.) | 9 // (The import statement and "google.protobuf." prefix need to be changed.) |
10 | 10 |
11 import "descriptor_2_5_opensource.proto"; | 11 import "descriptor_2_5_opensource.proto"; |
12 | 12 |
13 // A mixin to be applied in the 'with' clause of a generated proto in dart. | |
14 message DartMixin { | |
15 // Class name of the mixin class. | |
16 optional string name = 1; | |
17 | |
18 // File from which the mixin class is imported. | |
19 // The generated Dart code will use this in an import statement. | |
20 optional string import_from = 2; | |
21 | |
22 // Used to apply multiple mixins to a proto. | |
23 // The mixin listed in parent will always be applied before this one, | |
24 // making the generated proto implement both mixins. | |
25 optional string parent = 3; | |
26 } | |
27 | |
28 // Defines mixins imported from dart files to be used on messages in this file. | |
29 message ImportedMixins { | |
skybrian
2016/06/27 23:33:37
On second thought, maybe just "Imports". This will
| |
30 | |
31 // The DartMixins to be imported. | |
32 repeated DartMixin mixins = 1; | |
33 } | |
34 | |
13 extend google.protobuf.FileOptions { | 35 extend google.protobuf.FileOptions { |
14 | 36 |
37 // Defines the named mixins to be used on messages in this file. | |
38 // These mixins are in addition to internally defined mixins (e.g PbMapMixin) | |
39 // and may override them. | |
40 // Warning: there is no checking at compile time for name conflicts between | |
41 // identifiers defined in the mixin and proto-generated identifiers. | |
42 // Running dartanalyzer on the generated file might find some of them. | |
43 optional ImportedMixins imported_mixins = 28125061; | |
skybrian
2016/06/27 23:33:37
rename to "imports". Most of the comment can be mo
| |
44 | |
15 // Applies the named mixin to all messages in this file. | 45 // Applies the named mixin to all messages in this file. |
16 // (May be overridden by the "mixin" option on a message.) | 46 // (May be overridden by the "mixin" option on a message.) |
17 // For now, "PbMapMixin" is the only available mixin. | 47 // For now, "PbMapMixin" is the only available mixin. |
18 optional string default_mixin = 96128839; | 48 optional string default_mixin = 96128839; |
19 } | 49 } |
20 | 50 |
21 extend google.protobuf.MessageOptions { | 51 extend google.protobuf.MessageOptions { |
22 | 52 |
23 // Applies the named mixin. | 53 // Applies the named mixin. |
24 // For now, "PbMapMixin" is the only available mixin. | 54 // For now, "PbMapMixin" is the only available mixin. |
25 // The empty string can be used to turn off mixins for this message. | 55 // The empty string can be used to turn off mixins for this message. |
26 optional string mixin = 96128839; | 56 optional string mixin = 96128839; |
27 } | 57 } |
28 | 58 |
29 extend google.protobuf.FieldOptions { | 59 extend google.protobuf.FieldOptions { |
30 | 60 |
31 // Uses the given name for getters, setters and as suffixes for has/clear | 61 // Uses the given name for getters, setters and as suffixes for has/clear |
32 // methods in the generated Dart file. Should be lowerCamelCase. | 62 // methods in the generated Dart file. Should be lowerCamelCase. |
33 optional string dart_name = 28700919; | 63 optional string dart_name = 28700919; |
34 } | 64 } |
OLD | NEW |