I initially thought I was hitting the same issue as described in https://github.com/ZacSweers/MoshiX/issues/415, but decided to open a new issue because I don't get an error. Instead, I cannot seem to find any generated Proguard/R8 rules, and my generated adapters get minified away.
Some context: one of our apps has several sealed classes that live inside a package name that resembles com.example.data.model for which we rely on generated adapters. The package declaration of the generated adapters ends up being:
package com.example.`data`.model
And we actually see the same for adapters generated by moshi-kotlin-codegen.
What seems to differ is that we don't see any generated Proguard/R8 rules for classes generated by moshi-sealed-codegen, yet we do for classes generated by moshi-kotlin-codegen. But maybe I'm not looking in the right place? All classes live in a library module. Inside build/intermediates/generated_proguard_file/proguard.txt I see the rules moshi-kotlin-codegen generated, but none for our sealed classes covered by moshi-sealed-codegen.
As a result, everything works well, until we turn on minification. Then we get runtime errors stating the adapters generated by moshi-sealed-codegen cannot be found.
How do I confirm if moshi-proguard-rule-gen gets applied correctly? Where should I be able to find the rules it generated? Just in case, I tried explicitly declaring moshi-proguard-rule-gen as ksp dependency, but no joy.
We're currently on moshi:1.15.0 and moshix:0.24.3. I also tested with latest versions for both, but did not seem to make a difference.
I initially thought I was hitting the same issue as described in https://github.com/ZacSweers/MoshiX/issues/415, but decided to open a new issue because I don't get an error. Instead, I cannot seem to find any generated Proguard/R8 rules, and my generated adapters get minified away.
Some context: one of our apps has several sealed classes that live inside a package name that resembles
com.example.data.model
for which we rely on generated adapters. The package declaration of the generated adapters ends up being:And we actually see the same for adapters generated by
moshi-kotlin-codegen
.What seems to differ is that we don't see any generated Proguard/R8 rules for classes generated by
moshi-sealed-codegen
, yet we do for classes generated bymoshi-kotlin-codegen
. But maybe I'm not looking in the right place? All classes live in a library module. Insidebuild/intermediates/generated_proguard_file/proguard.txt
I see the rulesmoshi-kotlin-codegen
generated, but none for our sealed classes covered bymoshi-sealed-codegen
.As a result, everything works well, until we turn on minification. Then we get runtime errors stating the adapters generated by
moshi-sealed-codegen
cannot be found.How do I confirm if
moshi-proguard-rule-gen
gets applied correctly? Where should I be able to find the rules it generated? Just in case, I tried explicitly declaringmoshi-proguard-rule-gen
asksp
dependency, but no joy.We're currently on
moshi:1.15.0
andmoshix:0.24.3
. I also tested with latest versions for both, but did not seem to make a difference.