dart_code_gen 0.2.1 dart_code_gen: ^0.2.1 copied to clipboard
A command line tool which generates Dart code for Protobuf type registries.
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 agoogle.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 isspine_client
. The package should contain types:- declared in the
google.protobuf.*
package; - declared in the base module in Spine.
- declared in the
- Option
--import-prefix
specifies the path prefix for.pb.dart
files generated for types listed in thedescriptor
. Defaults to an empty path, implying that the generated files are located in the same directory as thedestination
. - Flag
--stdout
makes the tool print the output Dart code into the standard output stream, as well as writing it into thedestination
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.