wire-compiler / com.squareup.wire / WireCompiler

WireCompiler

class WireCompiler

Command line interface to the Wire Java generator.

Usage
java WireCompiler --proto_path=<path>
  [--java_out=<path>]
  [--kotlin_out=<path>]
  [--files=<protos.include>]
  [--includes=<message_name>[,<message_name>...]]
  [--excludes=<message_name>[,<message_name>...]]
  [--quiet]
  [--dry_run]
  [--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.

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.

If --quiet is specified, diagnostic messages to stdout are suppressed.

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.

Properties

dryRun

val dryRun: Boolean

emitAndroid

val emitAndroid: Boolean

emitAndroidAnnotations

val emitAndroidAnnotations: Boolean

emitCompact

val emitCompact: Boolean

fs

val fs: FileSystem

javaInterop

val javaInterop: Boolean

javaOut

val javaOut: String?

kotlinOut

val kotlinOut: String?

log

val log: WireLogger

namedFilesOnly

val namedFilesOnly: Boolean

protoPaths

val protoPaths: List<String>

pruningRules

val pruningRules: PruningRules

sourceFileNames

val sourceFileNames: List<String>

Functions

compile

fun compile(): Unit

Companion Object Properties

CODE_GENERATED_BY_WIRE

const val CODE_GENERATED_BY_WIRE: String

Companion Object Functions

forArgs

fun forArgs(fileSystem: FileSystem = FileSystems.getDefault(), logger: WireLogger = ConsoleWireLogger(), vararg args: String): WireCompiler

main

fun main(args: Array<String>): Unit