Ok, so I was faced with the same issue. I don't th...
# ksp
a
Ok, so I was faced with the same issue. I don't think modifying the sourcesets is the correct way since the source sets should be the inputs to KSP which will likely lead to some circular dependencies. Instead I was able to make it work by doing this:
Copy code
afterEvaluate {
    tasks.withType<Kapt> {
        val ksp = tasks.findByName(name.replace("kapt", "ksp")) as KspTask?
            ?: return@withType
        kaptExternalClasspath.from(ksp.destination)
    }
    tasks.withType<KaptGenerateStubsTask> {
        val ksp = tasks.findByName(name.replace("kaptGenerateStubs", "ksp")) as KspTask?
            ?: return@withType
        kaptClasspath.from(ksp.destination)
    }
}