Dart Code Generator

A command-line tool which generates Dart code for Protobuf type registries.

Usage

The generator accepts several command-line arguments:

  • Required option --descriptor specifies the path to a file which contains a google.protobuf.FileDescriptorSet. The descriptor set contains all the Protobuf types for which the tool must generate code.
  • Required option --destination specifies the path to the file into which the code must be written. If the file does not exist, it is created.
  • Option --standard-types specifies a Dart package which contains standard Protobuf types. The default value of this option is spine_client. The package should contain types:
    • declared in the google.protobuf.* package;
    • declared in the base module in Spine.
  • Option --import-prefix specifies the path prefix for .pb.dart files generated for types listed in the descriptor. Defaults to an empty path, implying that the generated files are located in the same directory as the destination.
  • Flag --stdout makes the tool print the output Dart code into the standard output stream, as well as writing it into the destination file.
  • Flag --no-stdout ensures that the tool does not print Dart code into the standard output stream. This is the default behaviour.
  • Flag --help (or -h for short), makes the tool print a brief usage guide. When called with this flag, all the other flags are ignored.

Libraries

any.pb
any.pbenum
any.pbjson
any.pbserver
api.pb
api.pbenum
api.pbjson
api.pbserver
color.pb
color.pbenum
color.pbjson
color.pbserver
dart_code_gen
descriptor.pb
descriptor.pbenum
descriptor.pbjson
descriptor.pbserver
duration.pb
duration.pbenum
duration.pbjson
duration.pbserver
email_address.pb
email_address.pbenum
email_address.pbjson
email_address.pbserver
empty.pb
empty.pbenum
empty.pbjson
empty.pbserver
error.pb
error.pbenum
error.pbjson
error.pbserver
field_filter.pb
field_filter.pbenum
field_filter.pbjson
field_filter.pbserver
field_mask.pb
field_mask.pbenum
field_mask.pbjson
field_mask.pbserver
field_path.pb
field_path.pbenum
field_path.pbjson
field_path.pbserver
internet_domain.pb
internet_domain.pbenum
internet_domain.pbjson
internet_domain.pbserver
language.pb
language.pbenum
language.pbjson
language.pbserver
options.pb
options.pbenum
options.pbjson
options.pbserver
person_name.pb
person_name.pbenum
person_name.pbjson
person_name.pbserver
plugin.pb
plugin.pbenum
plugin.pbjson
plugin.pbserver
source_context.pb
source_context.pbenum
source_context.pbjson
source_context.pbserver
struct.pb
struct.pbenum
struct.pbjson
struct.pbserver
timestamp.pb
timestamp.pbenum
timestamp.pbjson
timestamp.pbserver
type.pb
type.pbenum
type.pbjson
type.pbserver
url.pb
url.pbenum
url.pbjson
url.pbserver
validation_error.pb
validation_error.pbenum
validation_error.pbjson
validation_error.pbserver
wrappers.pb
wrappers.pbenum
wrappers.pbjson
wrappers.pbserver