Skip to content

Commit

Permalink
also generate things
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed Mar 6, 2024
1 parent 047d05b commit f4f14c9
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 40 deletions.
4 changes: 3 additions & 1 deletion protoc_plugin/lib/src/generated/dart_options.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import 'dart:core' as $core;

import 'package:protobuf/protobuf.dart' as $pb;

export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;

/// A mixin that can be used in the 'with' clause of the generated Dart class
/// for a proto message.
class DartMixin extends $pb.GeneratedMessage {
Expand Down Expand Up @@ -171,7 +173,7 @@ class Imports extends $pb.GeneratedMessage {
/// so the generated code may contain errors. Therefore, running dartanalyzer
/// on the generated file is a good idea.
@$pb.TagNumber(1)
$core.List<DartMixin> get mixins => $_getList(0);
$pb.PbList<DartMixin> get mixins => $_getList(0);
}

class Dart_options {
Expand Down
74 changes: 38 additions & 36 deletions protoc_plugin/lib/src/generated/descriptor.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import 'package:protobuf/protobuf.dart' as $pb;

import 'descriptor.pbenum.dart';

export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;

export 'descriptor.pbenum.dart';

/// The protocol compiler can output a FileDescriptorSet containing the .proto
Expand Down Expand Up @@ -71,7 +73,7 @@ class FileDescriptorSet extends $pb.GeneratedMessage {
static FileDescriptorSet? _defaultInstance;

@$pb.TagNumber(1)
$core.List<FileDescriptorProto> get file => $_getList(0);
$pb.PbList<FileDescriptorProto> get file => $_getList(0);
}

/// Describes a complete .proto file.
Expand Down Expand Up @@ -216,20 +218,20 @@ class FileDescriptorProto extends $pb.GeneratedMessage {

/// Names of files imported by this file.
@$pb.TagNumber(3)
$core.List<$core.String> get dependency => $_getList(2);
$pb.PbList<$core.String> get dependency => $_getList(2);

/// All top-level definitions in this file.
@$pb.TagNumber(4)
$core.List<DescriptorProto> get messageType => $_getList(3);
$pb.PbList<DescriptorProto> get messageType => $_getList(3);

@$pb.TagNumber(5)
$core.List<EnumDescriptorProto> get enumType => $_getList(4);
$pb.PbList<EnumDescriptorProto> get enumType => $_getList(4);

@$pb.TagNumber(6)
$core.List<ServiceDescriptorProto> get service => $_getList(5);
$pb.PbList<ServiceDescriptorProto> get service => $_getList(5);

@$pb.TagNumber(7)
$core.List<FieldDescriptorProto> get extension => $_getList(6);
$pb.PbList<FieldDescriptorProto> get extension => $_getList(6);

@$pb.TagNumber(8)
FileOptions get options => $_getN(7);
Expand Down Expand Up @@ -265,12 +267,12 @@ class FileDescriptorProto extends $pb.GeneratedMessage {

/// Indexes of the public imported files in the dependency list above.
@$pb.TagNumber(10)
$core.List<$core.int> get publicDependency => $_getList(9);
$pb.PbList<$core.int> get publicDependency => $_getList(9);

/// Indexes of the weak imported files in the dependency list.
/// For Google-internal migration only. Do not use.
@$pb.TagNumber(11)
$core.List<$core.int> get weakDependency => $_getList(10);
$pb.PbList<$core.int> get weakDependency => $_getList(10);

/// The syntax of the proto file.
/// The supported values are "proto2" and "proto3".
Expand Down Expand Up @@ -597,19 +599,19 @@ class DescriptorProto extends $pb.GeneratedMessage {
void clearName() => $_clearField(1);

@$pb.TagNumber(2)
$core.List<FieldDescriptorProto> get field => $_getList(1);
$pb.PbList<FieldDescriptorProto> get field => $_getList(1);

@$pb.TagNumber(3)
$core.List<DescriptorProto> get nestedType => $_getList(2);
$pb.PbList<DescriptorProto> get nestedType => $_getList(2);

@$pb.TagNumber(4)
$core.List<EnumDescriptorProto> get enumType => $_getList(3);
$pb.PbList<EnumDescriptorProto> get enumType => $_getList(3);

@$pb.TagNumber(5)
$core.List<DescriptorProto_ExtensionRange> get extensionRange => $_getList(4);
$pb.PbList<DescriptorProto_ExtensionRange> get extensionRange => $_getList(4);

@$pb.TagNumber(6)
$core.List<FieldDescriptorProto> get extension => $_getList(5);
$pb.PbList<FieldDescriptorProto> get extension => $_getList(5);

@$pb.TagNumber(7)
MessageOptions get options => $_getN(6);
Expand All @@ -626,15 +628,15 @@ class DescriptorProto extends $pb.GeneratedMessage {
MessageOptions ensureOptions() => $_ensure(6);

@$pb.TagNumber(8)
$core.List<OneofDescriptorProto> get oneofDecl => $_getList(7);
$pb.PbList<OneofDescriptorProto> get oneofDecl => $_getList(7);

@$pb.TagNumber(9)
$core.List<DescriptorProto_ReservedRange> get reservedRange => $_getList(8);
$pb.PbList<DescriptorProto_ReservedRange> get reservedRange => $_getList(8);

/// Reserved field names, which may not be used by fields in the same message.
/// A given name may only be reserved once.
@$pb.TagNumber(10)
$core.List<$core.String> get reservedName => $_getList(9);
$pb.PbList<$core.String> get reservedName => $_getList(9);
}

class ExtensionRangeOptions extends $pb.GeneratedMessage {
Expand Down Expand Up @@ -692,7 +694,7 @@ class ExtensionRangeOptions extends $pb.GeneratedMessage {

/// The parser stores options it doesn't recognize here. See above.
@$pb.TagNumber(999)
$core.List<UninterpretedOption> get uninterpretedOption => $_getList(0);
$pb.PbList<UninterpretedOption> get uninterpretedOption => $_getList(0);
}

/// Describes a field within a message.
Expand Down Expand Up @@ -1241,7 +1243,7 @@ class EnumDescriptorProto extends $pb.GeneratedMessage {
void clearName() => $_clearField(1);

@$pb.TagNumber(2)
$core.List<EnumValueDescriptorProto> get value => $_getList(1);
$pb.PbList<EnumValueDescriptorProto> get value => $_getList(1);

@$pb.TagNumber(3)
EnumOptions get options => $_getN(2);
Expand All @@ -1261,13 +1263,13 @@ class EnumDescriptorProto extends $pb.GeneratedMessage {
/// by enum values in the same enum declaration. Reserved ranges may not
/// overlap.
@$pb.TagNumber(4)
$core.List<EnumDescriptorProto_EnumReservedRange> get reservedRange =>
$pb.PbList<EnumDescriptorProto_EnumReservedRange> get reservedRange =>
$_getList(3);

/// Reserved enum value names, which may not be reused. A given name may only
/// be reserved once.
@$pb.TagNumber(5)
$core.List<$core.String> get reservedName => $_getList(4);
$pb.PbList<$core.String> get reservedName => $_getList(4);
}

/// Describes a value within an enum.
Expand Down Expand Up @@ -1448,7 +1450,7 @@ class ServiceDescriptorProto extends $pb.GeneratedMessage {
void clearName() => $_clearField(1);

@$pb.TagNumber(2)
$core.List<MethodDescriptorProto> get method => $_getList(1);
$pb.PbList<MethodDescriptorProto> get method => $_getList(1);

@$pb.TagNumber(3)
ServiceOptions get options => $_getN(2);
Expand Down Expand Up @@ -2087,7 +2089,7 @@ class FileOptions extends $pb.GeneratedMessage {
/// The parser stores options it doesn't recognize here.
/// See the documentation for the "Options" section above.
@$pb.TagNumber(999)
$core.List<UninterpretedOption> get uninterpretedOption => $_getList(20);
$pb.PbList<UninterpretedOption> get uninterpretedOption => $_getList(20);
}

class MessageOptions extends $pb.GeneratedMessage {
Expand Down Expand Up @@ -2257,7 +2259,7 @@ class MessageOptions extends $pb.GeneratedMessage {

/// The parser stores options it doesn't recognize here. See above.
@$pb.TagNumber(999)
$core.List<UninterpretedOption> get uninterpretedOption => $_getList(4);
$pb.PbList<UninterpretedOption> get uninterpretedOption => $_getList(4);
}

class FieldOptions extends $pb.GeneratedMessage {
Expand Down Expand Up @@ -2476,7 +2478,7 @@ class FieldOptions extends $pb.GeneratedMessage {

/// The parser stores options it doesn't recognize here. See above.
@$pb.TagNumber(999)
$core.List<UninterpretedOption> get uninterpretedOption => $_getList(6);
$pb.PbList<UninterpretedOption> get uninterpretedOption => $_getList(6);
}

class OneofOptions extends $pb.GeneratedMessage {
Expand Down Expand Up @@ -2532,7 +2534,7 @@ class OneofOptions extends $pb.GeneratedMessage {

/// The parser stores options it doesn't recognize here. See above.
@$pb.TagNumber(999)
$core.List<UninterpretedOption> get uninterpretedOption => $_getList(0);
$pb.PbList<UninterpretedOption> get uninterpretedOption => $_getList(0);
}

class EnumOptions extends $pb.GeneratedMessage {
Expand Down Expand Up @@ -2627,7 +2629,7 @@ class EnumOptions extends $pb.GeneratedMessage {

/// The parser stores options it doesn't recognize here. See above.
@$pb.TagNumber(999)
$core.List<UninterpretedOption> get uninterpretedOption => $_getList(2);
$pb.PbList<UninterpretedOption> get uninterpretedOption => $_getList(2);
}

class EnumValueOptions extends $pb.GeneratedMessage {
Expand Down Expand Up @@ -2704,7 +2706,7 @@ class EnumValueOptions extends $pb.GeneratedMessage {

/// The parser stores options it doesn't recognize here. See above.
@$pb.TagNumber(999)
$core.List<UninterpretedOption> get uninterpretedOption => $_getList(1);
$pb.PbList<UninterpretedOption> get uninterpretedOption => $_getList(1);
}

class ServiceOptions extends $pb.GeneratedMessage {
Expand Down Expand Up @@ -2781,7 +2783,7 @@ class ServiceOptions extends $pb.GeneratedMessage {

/// The parser stores options it doesn't recognize here. See above.
@$pb.TagNumber(999)
$core.List<UninterpretedOption> get uninterpretedOption => $_getList(1);
$pb.PbList<UninterpretedOption> get uninterpretedOption => $_getList(1);
}

class MethodOptions extends $pb.GeneratedMessage {
Expand Down Expand Up @@ -2879,7 +2881,7 @@ class MethodOptions extends $pb.GeneratedMessage {

/// The parser stores options it doesn't recognize here. See above.
@$pb.TagNumber(999)
$core.List<UninterpretedOption> get uninterpretedOption => $_getList(2);
$pb.PbList<UninterpretedOption> get uninterpretedOption => $_getList(2);
}

/// The name of the uninterpreted option. Each string represents a segment in
Expand Down Expand Up @@ -3061,7 +3063,7 @@ class UninterpretedOption extends $pb.GeneratedMessage {
static UninterpretedOption? _defaultInstance;

@$pb.TagNumber(2)
$core.List<UninterpretedOption_NamePart> get name => $_getList(0);
$pb.PbList<UninterpretedOption_NamePart> get name => $_getList(0);

/// The value of the uninterpreted option, in whatever type the tokenizer
/// identified it as during parsing. Exactly one of these should be set.
Expand Down Expand Up @@ -3233,15 +3235,15 @@ class SourceCodeInfo_Location extends $pb.GeneratedMessage {
/// this path refers to the whole field declaration (from the beginning
/// of the label to the terminating semicolon).
@$pb.TagNumber(1)
$core.List<$core.int> get path => $_getList(0);
$pb.PbList<$core.int> get path => $_getList(0);

/// Always has exactly three or four elements: start line, start column,
/// end line (optional, otherwise assumed same as start line), end column.
/// These are packed into a single field for efficiency. Note that line
/// and column numbers are zero-based -- typically you will want to add
/// 1 to each before displaying to a user.
@$pb.TagNumber(2)
$core.List<$core.int> get span => $_getList(1);
$pb.PbList<$core.int> get span => $_getList(1);

/// If this SourceCodeInfo represents a complete declaration, these are any
/// comments appearing before and after the declaration which appear to be
Expand Down Expand Up @@ -3315,7 +3317,7 @@ class SourceCodeInfo_Location extends $pb.GeneratedMessage {
void clearTrailingComments() => $_clearField(4);

@$pb.TagNumber(6)
$core.List<$core.String> get leadingDetachedComments => $_getList(4);
$pb.PbList<$core.String> get leadingDetachedComments => $_getList(4);
}

/// Encapsulates information about the original source file from which a
Expand Down Expand Up @@ -3415,7 +3417,7 @@ class SourceCodeInfo extends $pb.GeneratedMessage {
/// ignore those that it doesn't understand, as more types of locations could
/// be recorded in the future.
@$pb.TagNumber(1)
$core.List<SourceCodeInfo_Location> get location => $_getList(0);
$pb.PbList<SourceCodeInfo_Location> get location => $_getList(0);
}

class GeneratedCodeInfo_Annotation extends $pb.GeneratedMessage {
Expand Down Expand Up @@ -3489,7 +3491,7 @@ class GeneratedCodeInfo_Annotation extends $pb.GeneratedMessage {
/// Identifies the element in the original source .proto file. This field
/// is formatted the same as SourceCodeInfo.Location.path.
@$pb.TagNumber(1)
$core.List<$core.int> get path => $_getList(0);
$pb.PbList<$core.int> get path => $_getList(0);

/// Identifies the filesystem path to the original source .proto.
@$pb.TagNumber(2)
Expand Down Expand Up @@ -3591,7 +3593,7 @@ class GeneratedCodeInfo extends $pb.GeneratedMessage {
/// An Annotation connects some span of text in generated code to an element
/// of its generating .proto file.
@$pb.TagNumber(1)
$core.List<GeneratedCodeInfo_Annotation> get annotation => $_getList(0);
$pb.PbList<GeneratedCodeInfo_Annotation> get annotation => $_getList(0);
}

const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
Expand Down
24 changes: 24 additions & 0 deletions protoc_plugin/lib/src/generated/descriptor.pbenum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@ import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;

class FieldDescriptorProto_Type extends $pb.ProtobufEnum {
/// 0 is reserved for errors.
/// Order is weird for historical reasons.
static const FieldDescriptorProto_Type TYPE_DOUBLE =
FieldDescriptorProto_Type._(1, _omitEnumNames ? '' : 'TYPE_DOUBLE');
static const FieldDescriptorProto_Type TYPE_FLOAT =
FieldDescriptorProto_Type._(2, _omitEnumNames ? '' : 'TYPE_FLOAT');

/// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
/// negative values are likely.
static const FieldDescriptorProto_Type TYPE_INT64 =
FieldDescriptorProto_Type._(3, _omitEnumNames ? '' : 'TYPE_INT64');
static const FieldDescriptorProto_Type TYPE_UINT64 =
FieldDescriptorProto_Type._(4, _omitEnumNames ? '' : 'TYPE_UINT64');

/// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
/// negative values are likely.
static const FieldDescriptorProto_Type TYPE_INT32 =
FieldDescriptorProto_Type._(5, _omitEnumNames ? '' : 'TYPE_INT32');
static const FieldDescriptorProto_Type TYPE_FIXED64 =
Expand All @@ -32,10 +40,17 @@ class FieldDescriptorProto_Type extends $pb.ProtobufEnum {
FieldDescriptorProto_Type._(8, _omitEnumNames ? '' : 'TYPE_BOOL');
static const FieldDescriptorProto_Type TYPE_STRING =
FieldDescriptorProto_Type._(9, _omitEnumNames ? '' : 'TYPE_STRING');

/// Tag-delimited aggregate.
/// Group type is deprecated and not supported in proto3. However, Proto3
/// implementations should still be able to parse the group wire format and
/// treat group fields as unknown fields.
static const FieldDescriptorProto_Type TYPE_GROUP =
FieldDescriptorProto_Type._(10, _omitEnumNames ? '' : 'TYPE_GROUP');
static const FieldDescriptorProto_Type TYPE_MESSAGE =
FieldDescriptorProto_Type._(11, _omitEnumNames ? '' : 'TYPE_MESSAGE');

/// New in version 2.
static const FieldDescriptorProto_Type TYPE_BYTES =
FieldDescriptorProto_Type._(12, _omitEnumNames ? '' : 'TYPE_BYTES');
static const FieldDescriptorProto_Type TYPE_UINT32 =
Expand Down Expand Up @@ -81,6 +96,7 @@ class FieldDescriptorProto_Type extends $pb.ProtobufEnum {
}

class FieldDescriptorProto_Label extends $pb.ProtobufEnum {
/// 0 is reserved for errors
static const FieldDescriptorProto_Label LABEL_OPTIONAL =
FieldDescriptorProto_Label._(1, _omitEnumNames ? '' : 'LABEL_OPTIONAL');
static const FieldDescriptorProto_Label LABEL_REQUIRED =
Expand All @@ -107,6 +123,8 @@ class FieldDescriptorProto_Label extends $pb.ProtobufEnum {
class FileOptions_OptimizeMode extends $pb.ProtobufEnum {
static const FileOptions_OptimizeMode SPEED =
FileOptions_OptimizeMode._(1, _omitEnumNames ? '' : 'SPEED');

/// etc.
static const FileOptions_OptimizeMode CODE_SIZE =
FileOptions_OptimizeMode._(2, _omitEnumNames ? '' : 'CODE_SIZE');
static const FileOptions_OptimizeMode LITE_RUNTIME =
Expand All @@ -127,6 +145,7 @@ class FileOptions_OptimizeMode extends $pb.ProtobufEnum {
}

class FieldOptions_CType extends $pb.ProtobufEnum {
/// Default mode.
static const FieldOptions_CType STRING =
FieldOptions_CType._(0, _omitEnumNames ? '' : 'STRING');
static const FieldOptions_CType CORD =
Expand All @@ -148,10 +167,15 @@ class FieldOptions_CType extends $pb.ProtobufEnum {
}

class FieldOptions_JSType extends $pb.ProtobufEnum {
/// Use the default type.
static const FieldOptions_JSType JS_NORMAL =
FieldOptions_JSType._(0, _omitEnumNames ? '' : 'JS_NORMAL');

/// Use JavaScript strings.
static const FieldOptions_JSType JS_STRING =
FieldOptions_JSType._(1, _omitEnumNames ? '' : 'JS_STRING');

/// Use JavaScript numbers.
static const FieldOptions_JSType JS_NUMBER =
FieldOptions_JSType._(2, _omitEnumNames ? '' : 'JS_NUMBER');

Expand Down
Loading

0 comments on commit f4f14c9

Please sign in to comment.