Skip to content

//wire-compiler/com.squareup.wire/WireCompiler

WireCompiler

[jvm]\ class WireCompiler

Command line interface to the Wire Java generator.

Usage


java WireCompiler –proto_path=<path>\ [–java_out=<path>]\ [–kotlin_out=<path>]\ [–swift_out=<path>]\ [–files=<protos.include>]\ [–includes=<message_name>[,<message_name>…]]\ [–excludes=<message_name>[,<message_name>…]]\ [–android]\ [–android-annotations]\ [–compact]\ [file [file…]]

–java_out should provide the folder where the files generated by the Java code generator should be placed. Similarly, –kotlin_out should provide the folder where the files generated by the Kotlin code generator will be written. Only one of the two should be specified.

–swift_out should provide the folder where the files generated by the Swift code generator should be placed.

If the –includes flag is present, its argument must be a comma-separated list of fully-qualified message or enum names. The output will be limited to those messages and enums that are (transitive) dependencies of the listed names. The –excludes flag excludes types, and takes precedence over –includes.

If the –registry_class flag is present, its argument must be a Java class name. A class with the given name will be generated, containing a constant list of all extension classes generated during the compile. This list is suitable for passing to Wire’s constructor at runtime for constructing its internal extension registry.

The –dry_run flag causes the compile to just emit the names of the source files that would be generated to stdout.

The –android flag will cause all messages to implement the Parcelable interface. This implies –android-annotations as well.

The –android-annotations flag will add the Nullable annotation to optional fields.

The –compact flag will emit code that uses reflection for reading, writing, and toString methods which are normally implemented with code generation.

Types

Name Summary
Companion [jvm]
object Companion

Functions

Name Summary
compile [jvm]
fun compile()

Properties

Name Summary
emitAndroid [jvm]
val emitAndroid: Boolean
emitAndroidAnnotations [jvm]
val emitAndroidAnnotations: Boolean
emitAppliedOptions [jvm]
val emitAppliedOptions: Boolean
emitCompact [jvm]
val emitCompact: Boolean
emitDeclaredOptions [jvm]
val emitDeclaredOptions: Boolean
fs [jvm]
val fs: FileSystem
javaInterop [jvm]
val javaInterop: Boolean
javaOut [jvm]
val javaOut: String?
kotlinBoxOneOfsMinSize [jvm]
val kotlinBoxOneOfsMinSize: Int
kotlinOut [jvm]
val kotlinOut: String?
log [jvm]
val log: WireLogger
modules [jvm]
val modules: Map<String, WireRun.Module>
permitPackageCycles [jvm]
val permitPackageCycles: Boolean
protoPaths [jvm]
val protoPaths: List<String>
sourceFileNames [jvm]
val sourceFileNames: List<String>
swiftOut [jvm]
val swiftOut: String?
treeShakingRoots [jvm]
val treeShakingRoots: List<String>
treeShakingRubbish [jvm]
val treeShakingRubbish: List<String>