SchemaBuilder

Builds a schema out of written .proto files.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun add(name: Path, protoFile: String): SchemaBuilder
fun add(name: Path, protoFile: String, path: Path): SchemaBuilder

Add a file to be loaded into the schema.

Link copied to clipboard

Wire loads runtime protos such as google/protobuf/descriptor.proto when it needs to load a schema. This method adds empty protos to please Wire. However, if the proto schema getting loaded relies on those runtime protos' types like FieldOptions or wire_package, you will have to provide the original content of those files.

Link copied to clipboard
fun addOpaqueTypes(vararg opaqueTypes: ProtoType): SchemaBuilder

See SchemaLoader.opaqueTypes.

Link copied to clipboard
fun addProtoPath(name: Path, protoFile: String): SchemaBuilder

Add a file to be linked against, but not used to generate artifacts.

Link copied to clipboard
fun build(): Schema