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

KotlinTarget

data class KotlinTarget : Target

Generate .kt sources.

Constructors

<init>

KotlinTarget(includes: List<String> = listOf("*"), excludes: List<String> = listOf(), exclusive: Boolean = true, outDirectory: String, android: Boolean = false, javaInterop: Boolean = false, emitDeclaredOptions: Boolean = true, emitAppliedOptions: Boolean = false, emitKotlinSerialization: Boolean = false, rpcCallStyle: RpcCallStyle = RpcCallStyle.SUSPENDING, rpcRole: RpcRole = RpcRole.CLIENT, singleMethodServices: Boolean = false, boxOneOfsMinSize: Int = 5_000, grpcServerCompatible: Boolean = false)

Generate .kt sources.

Properties

android

val android: Boolean

True for emitted types to implement android.os.Parcelable.

boxOneOfsMinSize

val boxOneOfsMinSize: Int

If a oneof has more than or boxOneOfsMinSize fields, it will be generated using boxed oneofs as defined in OneOf.

emitAppliedOptions

val emitAppliedOptions: Boolean

True to emit annotations for options applied on messages, fields, etc.

emitDeclaredOptions

val emitDeclaredOptions: Boolean

True to emit types for options declared on messages, fields, etc.

emitKotlinSerialization

val emitKotlinSerialization: Boolean

True to emit annotations for kotlinx.serialization.

excludes

val excludes: List<String>

Proto types to excluded generated sources for. Types listed here will not be generated for this target.

exclusive

val exclusive: Boolean

True if types emitted for this target should not also be emitted for other targets. Use this to cause multiple outputs to be emitted for the same input type.

grpcServerCompatible

val grpcServerCompatible: Boolean

True to also generate gRPC server-compatible classes.

includes

val includes: List<String>

Proto types to include generated sources for. Types listed here will be generated for this target and not for subsequent targets in the task.

javaInterop

val javaInterop: Boolean

True for emitted types to implement APIs for easier migration from the Java target.

outDirectory

val outDirectory: String

rpcCallStyle

val rpcCallStyle: RpcCallStyle

Blocking or suspending.

rpcRole

val rpcRole: RpcRole

Client or server.

singleMethodServices

val singleMethodServices: Boolean

True for emitted services to implement one interface per RPC.