Hello :wave: Wondering if anyone tried using <http...
# serialization
d
Hello 👋 Wondering if anyone tried using https://github.com/tschuchortdev/kotlin-compile-testing together with
kotlinx-serialization
? I'm trying to test out my auto-generated code but since serialization build plugin wasn't run, my compilation is failing as the serialization generated code is not available (e.g.
<foo>.serializer()
on serializable objects). Any ideas/suggestions?
looks like the lib can accept custom compilers that implement
ComponentRegistrar
but don't see any references to that interface in the
kotlinx
lib... 😞
e
the serialization plugin is part of the Kotlin repo, not the kotlinx.serialization repo https://github.com/JetBrains/kotlin/tree/master/plugins/kotlin-serialization/kotlin-serialization-compiler
👍 1
d
Indeed it is part of main kotlin repo. I tried following https://youtrack.jetbrains.com/issue/KT-47900 to include
kotlin-serialization-unshaded
but sadly it doesn't work due to shaded package.... 😞 compiler complains about not implemented method as it uses
com.intellij.mock.MockProject
 (shaded) class vs 
<http://org.jetbrains.kotlin.com|org.jetbrains.kotlin.com>.intellij.mock.MockProject
(proper)
*tried using
org.jetbrains.kotlin:kotlin-serialization:1.5.31
as a dep but it also has the same problem
e
if that doesn't work then I don't know :-/
if nothing else, you could write a test using Gradle TestKit, but that would be slower
d
Oo unsure what changed but it started working today. Guessing maybe some old Gradle cache was messing things up.