WireCompiler

Command line interface to the Wire Java generator.

Usage

-----

java WireCompiler --proto_path=<path>
[--java_out=<path>]
[--kotlin_out=<path>]
[--swift_out=<path>]
[--custom_out=<path>]
[--schema_handler_factory_class=<class_name>]
[--files=<protos.include>]
[--includes=<message_name>[,<message_name>...]]
[--excludes=<message_name>[,<message_name>...]]
[--android]
[--android-annotations]
[--compact]
[--custom_option=<key>,<value>]
[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.

--event_listener_factory_class should be used if you want to add a EventListener. The factory class itself should be included in your classpath.

--logger_factory_class should be used if you want a custom WireLogger to be called. The factory class itself * should be included in your classpath.

--schema_handler_factory_class should be used if you want a custom SchemaHandler to be called. The factory class itself should be included in your classpath. If set, custom_out should also be provided and will passed to the factory's handler as a location to where it will be able to write files.

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 compiler 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.

The --custom_option flag will be passed onto the custom SchemaHandler if set. The flag can be used as many times as needed and all key/value pairs will be aggregated into a map. See com.squareup.wire.gradle.CustomOutput.options

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val fs: FileSystem
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val kotlinRpcCallStyle: RpcCallStyle
Link copied to clipboard
val kotlinRpcRole: RpcRole
Link copied to clipboard
val log: WireLogger
Link copied to clipboard
val modules: Map<String, WireRun.Module>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun compile()