Change Log

Unreleased

  • In-development snapshots are now published to the Central Portal Snapshots repository at https://central.sonatype.com/repository/maven-snapshots/.

Version 1.15.2

2024-12-05

  • Do not generate conditional shrinker rules (i.e., -if) when the rule is already predicated on the presence of the target type (as -keepnames and -keepclassmembers are). This will improve shrinker performance for projects with hundreds of model types, as conditional rules are more expensive to evaluate.

Version 1.15.1

2024-01-30

  • Upgrade to Okio 3.7.0

Version 1.15.0

2023-05-12

  • Upgrade to Kotlin 1.8.21.
  • Upgrade to KSP 1.8.21-1.0.11.
  • Upgrade to kotlinx-metadata 0.6.0.
  • Upgrade to KotlinPoet 1.13.2.
  • Support Kotlin language version 1.9.0 in KAPT.
  • Include name of the type being processed when creating the adapterGenerator fails in KSP.
  • Suppress UNUSED_PARAMETER in generated code.
  • Deprecate KAPT code gen. Please migrate to KSP, we will remove KAPT support in a future release. This release will also print an annoying noisy warning in KAPT processing if you use it.

Version 1.14.0

2022-09-06

Version 1.13.0

2021-12-08

  • New: Support for Kotlin Symbol Processing (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 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.

... and so on for all previous versions.