Hello - just ported my project from KAPT to KSP, s...
# ksp
a
Hello - just ported my project from KAPT to KSP, so far experience has been great! But I'm having issues configuring the Gradle JVM Toolchain for the KspTask. Is there any documentation for how to set it up? For KAPT I had to add this snippet to my subProjects block:
Copy code
tasks.withType<org.jetbrains.kotlin.gradle.internal.KaptTask> {
        kotlinJavaToolchain.toolchain.use(customLauncher)
    }
e
why would you set a specific toolchain for the kps only? I'd expect it to use the same toolchain the sources themselves are using, or?
a
Setting just the kotlin toolchain just doesn't work at all in my project. I've tried only setting:
Copy code
kotlin {
    jvmToolchain {
        (this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(17))
    }
}
e
what do you mean doesnt work?
a
I do have a multi module project and I suspect that may be why, so I have to use a custom launcher and apply it to each task type. I was able to work around this problem with KAPT but no matter what I do to the KspTasks they seem to use the wrong version of the JVM.
e
However I suggest you to ask in #ksp, they are pretty responsive
😄 1
a
I get an error stating that code was compiled with the wrong version of the JVM on jenkins, which has Java 8 on it
I did post this in ksp right?