Last active
January 29, 2023 21:27
-
-
Save drawers/d815c26210fbb1ca1b2c0748f7339c76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun KotlinCompilation.generatedSourceFor(fileName: String): String { | |
return kspSourcesDir.walkTopDown() | |
.firstOrNull { it.name == fileName } | |
?.readText() | |
?: 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