Releases: ZacSweers/MoshiX
0.24.1
- Fix: Use correct name for each
KotlinCompilation
'simplementation
configuration in KMP projects. Note that Moshi still only supports JVM/Android. - Update to Kotlin 1.9.10.
- Update to KSP 1.9.10-1.0.13.
- Compile against Gradle 8.3.
- Remove shaded anvil-compiler-utils dependency from moshi-ir.
What's Changed
- Update kotlinCompileTesting to v0.3.2 by @renovate in #472
- Update ksp to v1.9.0-1.0.13 by @renovate in #473
- Update plugin moshix to v0.24.0 by @renovate in #467
- Update dependency com.android.tools.build:gradle to v8.1.0 by @renovate in #469
- Update dependency com.google.guava:guava to v32.1.2-jre by @renovate in #471
- Remove anvil compiler utils by @ZacSweers in #474
- Update dependency gradle to v8.3 by @renovate in #475
- Update dependency com.android.tools.build:gradle to v8.1.1 by @renovate in #479
- Update plugin dokka to v1.9.0 by @renovate in #484
- Update plugin spotless to v6.21.0 by @renovate in #483
- Update kotlin monorepo to v1.9.10 by @renovate in #481
- Fix configuration name reading in gradle by @ZacSweers in #487
Full Changelog: 0.24.0...0.24.1
0.24.0
New: Move proguard rule generation to a standalone KSP processor.
This is necessary in order to support both K2 and avoid incremental compilation issues in Kotlin 1.9.x.
For moshi-sealed KSP users, there should be no changes necessary.
For moshi-ir users, you must now apply the KSP gradle plugin as well as the moshix plugin. MoshiX's gradle plugin does not directly declare a transitive dependency on the KSP plugin to avoid Gradle classloader conflicts.
plugins {
// Other plugins
id("dev.zacsweers.moshix") version "x.y.z"
+ id("com.google.devtools.ksp") version "x.y.z"
}
If you don't want this or don't need proguard rule generation, you can opt out by setting the moshix.generateProguardRules
gradle property to false
.
- Update KSP to
1.9.0-1.0.12
. - Update KotlinPoet to
1.14.2
. - Update to kotlinx-metadata
0.7.0
. - Update to Guava
32.1.1-jre
.
What's Changed
- Update dependency dev.zacsweers.autoservice:auto-service-ksp to v1.1.0 by @renovate in #453
- remove local development section from README.md by @j-roskopf in #455
- Update dependency gradle to v8.2.1 by @renovate in #454
- Update dependency com.google.guava:guava to v32.1.1-jre by @renovate in #447
- Update plugin moshix to v0.23.0 by @renovate in #452
- Update kotlinx-metadata to 0.7.0 by @renovate in #456
- Reimplement proguard rule gen in KSP by @ZacSweers in #457
- Update plugin spotless to v6.20.0 by @renovate in #458
- Update kotlinCompileTesting to v0.3.0 by @renovate in #451
- Fix proguard rule output location by @ZacSweers in #463
- Update kotlinpoet to v1.14.2 by @renovate in #462
- Update dependency dev.zacsweers.kctfork:ksp to v0.3.1 by @renovate in #466
- Update ksp to v1.9.0-1.0.12 by @renovate in #465
New Contributors
- @j-roskopf made their first contribution in #455
Full Changelog: 0.23.0...0.24.0
0.24.0-RC2
- Fix: Write generated proguard rules to the correct resources path.
0.24.0-RC
New: Move proguard rule generation to a standalone KSP processor.
This is necessary in order to support both K2 and avoid incremental compilation issues in Kotlin 1.9.x.
For moshi-sealed KSP users, there should be no changes necessary.
For moshi-ir users, you must now apply the KSP gradle plugin as well as the moshix plugin. MoshiX's gradle plugin does not directly declare a transitive dependency on the KSP plugin to avoid Gradle classloader conflicts.
plugins {
// Other plugins
id("dev.zacsweers.moshix") version "x.y.z"
+ id("com.google.devtools.ksp") version "x.y.z"
}
If you don't want this or don't need proguard rule generation, you can opt out by setting the moshix.generateProguardRules
gradle property to false
.
This first release is an RC release to ensure there are no issues with the new standalone processor. If you encounter any issues, please file them!
What's Changed
- Update dependency dev.zacsweers.autoservice:auto-service-ksp to v1.1.0 by @renovate in #453
- remove local development section from README.md by @j-roskopf in #455
- Update dependency gradle to v8.2.1 by @renovate in #454
- Update dependency com.google.guava:guava to v32.1.1-jre by @renovate in #447
- Update plugin moshix to v0.23.0 by @renovate in #452
- Update kotlinx-metadata to 0.7.0 by @renovate in #456
- Reimplement proguard rule gen in KSP by @ZacSweers in #457
- Update plugin spotless to v6.20.0 by @renovate in #458
- Update kotlinCompileTesting to v0.3.0 by @renovate in #451
New Contributors
- @j-roskopf made their first contribution in #455
Full Changelog: 0.23.0...0.24.0-RC
0.23.0
- Update to Kotlin
1.9.0
. The moshi-ir plugin now requires1.9.0
. - Update
kotlinx-metadata
to0.6.2
. - Update shaded Anvil utils to
2.4.6
. - Update Moshi to
1.15.0
. - Update KSP to
1.9.0-1.0.11
.
What's Changed
- Update plugin moshix to v0.22.1 by @renovate in #414
- Update dependency gradle to v8.1.1 by @renovate in #418
- Update ksp to v1.8.21-1.0.11 by @renovate in #416
- Update plugin kotlinBinaryCompatibilityValidator to v0.13.1 by @renovate in #417
- Update moshi to v1.15.0 by @renovate in #425
- Update dependency com.squareup.moshi:moshi to v1.15.0 by @renovate in #424
- Update dependency com.android.tools.build:gradle to v8.0.1 by @renovate in #421
- Update autoService to v1.1.0 by @renovate in #426
- Update okhttp to v4.11.0 by @renovate in #419
- Update dependency com.facebook:ktfmt to v0.44 by @renovate in #420
- Update plugin spotless to v6.19.0 by @renovate in #427
- Update dependency com.android.tools.build:gradle to v8.0.2 by @renovate in #429
- Update dependency com.google.guava:guava to v32 by @renovate in #431
- Update dependency com.squareup.anvil:compiler-utils to v2.4.6 by @renovate in #430
- Update plugin kotlinBinaryCompatibilityValidator to v0.13.2 by @renovate in #435
- Update plugin dokka to v1.8.20 by @renovate in #436
- Update dependency com.google.truth:truth to v1.1.4 by @renovate in #434
- Update dependency com.google.truth:truth to v1.1.4 by @renovate in #433
- Update kotlin monorepo by @renovate in #432
- Force kotlin 1.8 for gradle plugin by @ZacSweers in #437
- Update ksp to v1.8.22-1.0.11 by @renovate in #438
- Update dependency com.google.guava:guava to v32.0.1-jre by @renovate in #439
- Update dependency com.google.truth:truth to v1.1.5 by @renovate in #444
- Update dependency com.google.truth:truth to v1.1.5 by @renovate in #445
- Update dependency com.google.auto:auto-common to v1.2.2 by @renovate in #441
- Update autoService to v1.1.1 by @renovate in #440
- Update dependency gradle to v8.2 by @renovate in #448
- Update plugin mavenPublish to v0.25.3 by @renovate in #449
- Update to Kotlin 1.9.0 by @ZacSweers in #428
Full Changelog: 0.22.1...0.23.0
0.22.1
moshi-sealed
Keep signatures for typed annotated with @NestedSealed
. This ensures that the annotation, itself isn't stripped from the use on the class.
This is done via this keep rule in moshi-sealed-runtime's embedded proguard rules, which should still allow strinking/optimization of the class itself.
-keepnames @dev.zacsweers.moshix.sealed.annotations.NestedSealed class **
0.22.0
Highlights
- Update to Kotlin
1.8.20
. Kotlin 1.8.20 or later is required formoshi-ir
. - Update to KSP
1.8.20-1.0.10
. - Update kotlinx-metadata-jvm to
0.6.0
. - Fix: Don't use experimental-gated addAdapter with generated object adapters.
All Changes
- Update plugin moshix to v0.21.0 by @renovate in #360
- Update plugin mavenPublish to v0.23.0 by @renovate in #361
- Update plugin mavenPublish to v0.23.1 by @renovate in #362
- Update plugin spotless to v6.12.1 by @renovate in #363
- Update dependency org.assertj:assertj-core to v3.24.0 by @renovate in #364
- Update dependency org.assertj:assertj-core to v3.24.1 by @renovate in #365
- Update kotlinCompileTesting to v0.2.1 by @renovate in #366
- Update Anvil to 2.4.4 by @ZacSweers in #370
- Update dependency com.android.tools.build:gradle to v7.4.0 by @renovate in #369
- Update plugin spotless to v6.13.0 by @renovate in #372
- Update dependency org.assertj:assertj-core to v3.24.2 by @renovate in #373
- update kotlinx-metadata-jvm to 0.6.0 by @gabrielittner in #375
- Update ksp to v1.8.0-1.0.9 by @renovate in #377
- Update plugin spotless to v6.14.0 by @renovate in #378
- Update plugin mavenPublish to v0.24.0 by @renovate in #374
- Update dependency com.android.tools.build:gradle to v7.4.1 by @renovate in #379
- Update incap to v1 (major) by @renovate in #376
- Update ksp to v1.8.10-1.0.9 by @renovate in #380
- Update plugin spotless to v6.14.1 by @renovate in #381
- Update dependency com.facebook:ktfmt to v0.43 by @renovate in #383
- Update plugin spotless to v6.15.0 by @renovate in #385
- Update plugin kotlinBinaryCompatibilityValidator to v0.13.0 by @renovate in #387
- Fix a typo in the sealed readme by @ansman in #388
- Update dependency com.android.tools.build:gradle to v7.4.2 by @renovate in #393
- Update plugin spotless to v6.16.0 by @renovate in #394
- Update plugin spotless to v6.17.0 by @renovate in #398
- Update plugin dokka to v1.8.10 by @renovate in #395
- Update dependency gradle to v8 by @renovate in #386
- Update plugin mavenShadow to v8 by @renovate in #391
- Update plugin mavenPublish to v0.25.0 by @renovate in #400
- Update plugin mavenPublish to v0.25.1 by @renovate in #401
- Update plugin mavenShadow to v8.1.1 by @renovate in #399
- Don't use experimental-gated addAdapter with object adapters by @ZacSweers in #404
- Update to Kotlin 1.8.20 by @ZacSweers in #384
New Contributors
Full Changelog: 0.21.0...0.22.0
0.21.0
2022-12-28
New: Update to Kotlin 1.8.0
.
- For moshi-ir, this release is only compatible with Kotlin 1.8 or later.
- Migrate the IR and AnalysisHandlerExtension plugins to new
CompilerPluginRegistrar
entrypoint API.
New: Experimental support for the new K2 compiler in moshi-ir.
Note this comes with several caveats:
- There is no FIR plugin in moshi-ir itself (not needed). This just marks itself as compatible with the new compiler and avoids using incompatible IR APIs.
- This only works if proguard rule generation is disabled, as there is no support in FIR currently for generating files.
- K2 compiler itself is extremely experimental.
In short, this is only really to unblock anyone doing their own testing of K2 and don't want this
plugin to disable it. If you see any issues, please file a bug here and disable K2 in your project
in the meantime.
Misc
- Update JVM target to
11
. - Update Anvil
compiler-utils
to2.4.3
.
What's Changed
- Update plugin moshix to v0.20.0 by @renovate in #351
- Standardize options and descriptions by @ZacSweers in #356
- Update dependency com.squareup.anvil:compiler-utils to v2.4.3 by @renovate in #354
- Update dependency com.facebook:ktfmt to v0.42 by @renovate in #353
- Fix artifact ID setting by @ZacSweers in #357
- Kotlin 1.8.0 support by @ZacSweers in #352
- Update to JVM target 11 by @ZacSweers in #359
Full Changelog: 0.20.0...0.21.0
0.20.0
New: @FallbackJsonAdapter
moshi-sealed now supports a new @FallbackJsonAdapter
. This is a proxy to Moshi's PolymorphicJsonAdapter.withFallbackJsonAdapter()
. This allows you to specify a custom JsonAdapter
to handle cases of unrecognized type labels in decoding. It's advanced usage and not recommended for regular cases.
The specified JsonAdapter
must have a public constructor with no parameters or a single Moshi
parameter.
@FallbackJsonAdapter(FrogFallbackJsonAdapter::class)
@JsonClass(generateAdapter = true, generator = "sealed:type")
sealed class Frog {
@JsonClass(generateAdapter = true)
@TypeLabel("original", null)
data class OriginalFrog(...)
@JsonClass(generateAdapter = true)
@TypeLabel("poisonous")
data class PoisonousFrog(...)
class FrogFallbackJsonAdapter(moshi: Moshi) : JsonAdapter<Frog>() {
private val delegate = moshi.adapter<OriginalFrog>()
override fun fromJson(reader: JsonReader): Frog? {
// Default to original frog
return delegate.fromJson(reader)
}
//...
}
}
New: Experimental support for the new K2 compiler in moshi-ir.
Edit: this isn't usable in this release, don't try to use it!
Misc
- Enhancement: Generate extra proguard rules for
@NestedSealed
types to prevent R8 from inlining the parent sealed type into the subtype in some cases. - Enhancement: Proguard generation in moshi-ir now uses Anvil's more optimized compiler util APIs.
- Enhancement: Check and report more error cases in moshi-ir and moshi-sealed code gen.
- Fix: moshi-ir now properly generates proguard rules for moshi-sealed types.
- Fix: track
@NestedSealed
types as originating files in moshi-sealed KSP. - Enhancement: Substantially improved KSP and IR test coverage of error cases.
- Update to Kotlin
1.7.22
. - Update to KSP
1.7.22-1.0.8
.
What's Changed
- Update plugin dokka to v1.7.20 by @renovate in #334
- Update dependency com.android.tools.build:gradle to v7.3.1 by @renovate in #335
- Update ksp to v1.7.20-1.0.7 by @renovate in #336
- Update plugin kotlinBinaryCompatibilityValidator to v0.12.0 by @renovate in #337
- Update plugin kotlinBinaryCompatibilityValidator to v0.12.1 by @renovate in #338
- Update plugin org.jetbrains.kotlin.jvm to v1.7.20 by @renovate in #339
- Update ksp to v1.7.20-1.0.8 by @renovate in #340
- Update ksp to v1.7.21-1.0.8 by @renovate in #343
- Update plugin spotless to v6.12.0 by @renovate in #344
- Update dependency gradle to v7.6 by @renovate in #345
- Switch to maintained KCT + support K2 in some places by @ZacSweers in #347
- Update ksp to v1.7.22-1.0.8 by @renovate in #346
- Update kotlin monorepo to v1.7.22 by @renovate in #341
- Generate extra proguard rules to keep parent sealed adapters for subclass usages by @ZacSweers in #348
- Implement
@FallbackJsonAdapter
by @ZacSweers in #350
Full Changelog: 0.19.0...0.20.0
0.19.0
- Update to Kotlin
1.7.20
. - Update to KSP
1.7.20-1.0.6
.
Note this release requires Kotlin 1.7.20 or newer.
What's Changed
- Update plugin org.jetbrains.kotlin.jvm to v1.7.10 by @renovate in #308
- Update kotlin to v1.7.10 by @renovate in #307
- Update ksp to v1.7.10-1.0.6 by @renovate in #309
- Update plugin kotlinBinaryCompatibilityValidator to v0.11.0 by @renovate in #311
- Update plugin spotless to v6.9.0 by @renovate in #314
- Update dependency gradle to v7.5 by @renovate in #313
- Update plugin dokka to v1.7.10 by @renovate in #312
- Update dependency com.android.tools.build:gradle to v7.2.2 by @renovate in #317
- Update dependency gradle to v7.5.1 by @renovate in #318
- Update plugin spotless to v6.9.1 by @renovate in #319
- Update plugin spotless to v6.10.0 by @renovate in #321
- Update plugin kotlinBinaryCompatibilityValidator to v0.11.1 by @renovate in #323
- Update moshi to v1.14.0 by @renovate in #326
- Update dependency com.squareup.moshi:moshi to v1.14.0 by @renovate in #325
- Update to maven publish plugin 0.22.0 by @ZacSweers in #327
- Update plugin spotless to v6.11.0 by @renovate in #329
- Update dependency com.android.tools.build:gradle to v7.3.0 by @renovate in #330
- Update dependency com.facebook:ktfmt to v0.41 by @renovate in #331
- Kotlin 1.7.20 support by @ZacSweers in #316
Full Changelog: 0.18.3...0.19.0