Moshi v1.13.0 Release Notes
-
2021-12-08
- New: Support for [Kotlin Symbol Processing (KSP)][ksp]. KSP is an alternative to annotation processing code gen. It's builds faster and better supports Kotlin language features.
To use KSP in your application you must enable the KSP Gradle plugin and add a KSP dependency on Moshi codegen.
``` plugins { id("com.google.devtools.ksp").version("1.6.0-1.0.1") } dependencies { ksp("com.squareup.moshi:moshi-kotlin-codegen:1.13.0") } ```
If you're switching from annotation processing (kapt) to KSP, you should remove the kapt plugin and the kapt Moshi dependency.
- New:
@Json(ignore = true)
is a Moshi-specific way to exclude properties from JSON encoding and decoding. - New: Support Java 16 records. (Moshi still requires Java 8 only; we're shipping a [multi-release jar][mrjar] to better support modern JVMs.)
New: Option to disable generating R8/ProGuard files. These files prevent code shrinkers from removing files that support JSON processing. If you're not using ProGuard or R8, you can skip this step.
ksp { arg("moshi.generateProguardRules", "false") }
Upgrade: [Kotlin 1.6.0][kotlin_1_6_0].