Skip to content

Instantly share code, notes, and snippets.

Last active January 29, 2023 21:27
What would you like to do?
private fun KotlinCompilation.generatedSourceFor(fileName: String): String {
return kspSourcesDir.walkTopDown()
.firstOrNull { == fileName }
?: throw IllegalArgumentException(
"Unable to find $fileName in ${
kspSourcesDir.walkTopDown().filter { it.isFile }.toList()
private val KotlinCompilation.kspWorkingDir: File
get() = workingDir.resolve("ksp")
private val KotlinCompilation.kspSourcesDir: File
get() = kspWorkingDir.resolve("sources")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment