Required Instance Propertyswift-protobuf 1.28.1SwiftProtobufPluginLibrary
supportedFeatures
The list of features this CodeGenerator support to be reported back to the protocol buffer compiler.
CodeGenerator.swift:48var supportedFeatures: [Google_Protobuf_Compiler_CodeGeneratorResponse.Feature] { get }
Other requirements
Type members
Instance members
var copyrightLine: String?
If provided and
printHelp
isn’t provide, this value will be including in default output for the--help
output.var customOptionExtensions: [any AnyMessageExtension]
A list of extensions that define Custom Options (https://protobuf.dev/programming-guides/proto2/#customoptions) for this generator so they will be exposed on the
Descriptor
options.var projectURL: String?
If provided and
printHelp
isn’t provide, this value will be including in default output for the--help
output.var supportedEditionRange: ClosedRange<Google_Protobuf_Edition>
The Protobuf Edition range that this generator can handle. Attempting to generate for an Edition outside this range will cause protoc to error.
var version: String?
If provided, the argument parsing will support
--version
and report this value.func generate(files: [FileDescriptor], parameter: any CodeGeneratorParameter, protoCompilerContext: any ProtoCompilerContext, generatorOutputs: any GeneratorOutputs
) throws Generates code for the given proto files.
func printHelp(
) Will be called for
-h
or--help
, shouldprint()
out whatever is desired; there is a default implementation that uses the above info when provided.