wire-compiler / com.squareup.wire.schema / SchemaLoader

SchemaLoader

class SchemaLoader : Closeable, Loader, ProfileLoader

Load proto files and their transitive dependencies and parse them. Keep track of which files were loaded from where so that we can use that information later when deciding what to generate.

Constructors

<init>

SchemaLoader(fileSystem: FileSystem)

Properties

permitPackageCycles

var permitPackageCycles: Boolean

Strict by default. Note that golang cannot build protos with package cycles.

sourcePathFiles

var sourcePathFiles: List<ProtoFile>

Subset of the schema that was loaded from the source path.

Functions

close

fun close(): Unit

initRoots

fun initRoots(sourcePath: List<Location>, protoPath: List<Location> = listOf()): Unit

Initialize the WireRun.sourcePath and WireRun.protoPath from which files are loaded.

load

fun load(path: String): ProtoFile

loadProfile

fun loadProfile(name: String, schema: Schema): Profile

loadSchema

fun loadSchema(): Schema

withErrors

fun withErrors(errors: ErrorCollector): SchemaLoader