Daniil Elovkov
11/28/2024, 9:21 PMimplementation(kotlin("reflect"))
, and also if it’s specified as ksp dependency as ksp(kotlin("reflect")
in the generated module.
Kotlin stdlib works with the reflection in a special way. There is kotlin.jvm.internal.Reflection
class which in its static section tries to do Class.forName("kotlin.reflect.jvm.internal.ReflectionFactoryImpl")
If it doesn’t succeed then all later reflection calls will not work and will throw exception. The class being loaded is not in stdlib, but in reflect.
At this stage (static section) the current classpath contains only what KSP has put there during configuring KspAATask, namely the 5 jars listed in KspAATask.kt starting from line 143 (as of tag 2.1.0-1.0.29). Even coroutines jar is there. However, reflect is not.
Could reflect.jar be placed there as well, given its special treatment by stdlib?
Thanks!Daniil Elovkov
11/28/2024, 9:26 PM