-
In my project I use moshi-ir and I wanted to update to Kotlin 1.9.0 and moshi-ir 0.23.0. I've noticed that 0.24.0-RC release notes mention that there are some incremental compilation issues in Kotlin 1.9.x related to using moshi-ir and Proguard rules generation. What kind of issues are those? Do they affect build time only or also correctness of generated classes/rules? Does this mean that I should restrain from updating Kotlin and moshi-ir in production until 0.24.0 is released? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Bunch of questions in there so let me do them individually
In short, anything using Secondly,
The generated rules are fine, generated classes were never affected as those are implemented in IR. Build times aren't affected meaningfully, though there is a non-zero amount added to run KSP first. I'm pursuing a proposal to allow this processor to opt-out of making the KSP task a dependency of the compile kotlin task, as in theory they can run in parallel.
For non-incremental builds it's fine, and in your debug builds you probably don't need proguard rules anyway. It's been working "fine" essentially up to this point, this is just a more correct and long term solution. |
Beta Was this translation helpful? Give feedback.
Bunch of questions in there so let me do them individually
In short, anything using
AnalysisHandlerExtension
must implement their own support for incremental compilation because KGP does not expose an API for this. KSP and Kapt are built on this as well, but implement their own incremental support as they host their own tasks. As a result, for correctness we need to use KSP.Secondly,
AnalysisHandlerExtension
is not supported in K2, so we cannot rely on it. KSP and kapt "work" with K2 insofar as they force their tasks to use a lower version of kotlin rather than K2, so they still run with the old frontend. KSP is working on a new implementation built on to…