Dariusz Kuc
08/14/2023, 10:08 PMkotlin-compile-testing
(Zac's fork with support for Kotlin 1.8) with kotlinx-serialization
?
Trying to compile my auto-generated sources but getting compilation error complaining about Unresolved reference: serializer
(from calls on @Serializable
classes -> MySerializableClass.serializer()
). It kind of looks like the SerializationComponentRegistrar
is not applied
val compilationResult = KotlinCompilation().apply {
jvmTarget = "1.8"
sources = generatedSources
inheritClassPath = true
compilerPluginRegistrars = listOf(SerializationComponentRegistrar())
}.compile()
libs
kotlin = "1.8.0"
kotlinx-coroutines = "1.7.3"
kotlinx-serialization = "1.5.1"
compile-testing = "0.2.1"
Dariusz Kuc
08/15/2023, 11:43 PMDariusz Kuc
08/15/2023, 11:43 PMorg.jetbrains.kotlinx.serialization.compiler.extensions.SerializationComponentRegistrar
(used in my unit tests through kotlin-compile-testing
) - is there something missing? anyone else encountered this problem?Dariusz Kuc
08/15/2023, 11:44 PMDariusz Kuc
08/16/2023, 12:22 AMorg.jetbrains.kotlinx.serialization.compiler.extensions.SerializationComponentRegistrar
class
*another odd issue is that sources JARs actually DO NOT contain all source files and include only a subset of filesDariusz Kuc
08/16/2023, 12:45 AMZac Sweers
08/16/2023, 1:03 AMDariusz Kuc
08/16/2023, 1:14 AMDariusz Kuc
08/16/2023, 9:34 PMkotlin-serialization-unshaded
and kotlin-serialization-compiler-plugin
dependencies (which contain the serialization registrar) directly but those fail with NoSuchMethodError
implying there are some classpath issues there but nothing obvious pops out (as in all deps show kotlin 1.9) -> https://scans.gradle.com/s/6hmz6vv6eab7s/dependencies?toggled=W1syXSxbMiwxM11d
If anyone has any ideas I'm all ears. Any help would be greatly appreciated