ProguardConfig

data class ProguardConfig(    val targetClass: ClassName,     val adapterName: String,     val adapterConstructorParams: List<String>,     val targetConstructorHasDefaults: Boolean,     val targetConstructorParams: List<String>)

Represents a proguard configuration for a given spec. This covers three main areas:

  • Keeping the target class name to Moshi's reflective lookup of the adapter.

  • Keeping the generated adapter class name + public constructor for reflective lookup.

  • Keeping any used JsonQualifier annotations and the properties they are attached to.

  • If the target class has default parameter values, also keeping the associated synthetic constructor as well as the DefaultConstructorMarker type Kotlin adds to it.

Each rule is intended to be as specific and targeted as possible to reduce footprint, and each is conditioned on usage of the original target type.

To keep this processor as an ISOLATING incremental processor, we generate one file per target class with a deterministic name (see outputFilePathWithoutExtension) with an appropriate originating element.

Constructors

Link copied to clipboard
fun ProguardConfig(    targetClass: ClassName,     adapterName: String,     adapterConstructorParams: List<String>,     targetConstructorHasDefaults: Boolean,     targetConstructorParams: List<String>)

Functions

Link copied to clipboard
fun outputFilePathWithoutExtension(canonicalName: String): String
Link copied to clipboard
fun writeTo(out: Appendable)

Properties

Link copied to clipboard
val adapterConstructorParams: List<String>
Link copied to clipboard
val adapterName: String
Link copied to clipboard
val targetClass: ClassName
Link copied to clipboard
val targetConstructorHasDefaults: Boolean
Link copied to clipboard
val targetConstructorParams: List<String>