tschuchortdev / kotlin-compile-testing

A library for testing Kotlin and Java annotation processors, compiler plugins and code generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't find place of storing generated files by ksp

Coolmanakov opened this issue · comments

commented

Here is my code

val compilation = KotlinCompilation().apply {
sources = listOf(sourceFile)
symbolProcessorProviders = listOf(KspProvider())
inheritClassPath = true
kspWithCompilation = true
workingDir = File(testWorkingDir)
}
compilationResult = compilation.compile()

compilationResult.generatedFiles contains necessary files, but they are compiled equivalent of what I really need, that's why I can not compare them with expected
But I have generated files in build/generated/ksp/..., but KotlinCompilation.Result property sourcesGeneratedByAnnotationProcessor is empty. It means, that generating is working fine, but access to them impossible thing - in my experience.
How can I take the generated files while testing my processor?
My issue has the same problem as already opened issue #129

See this for file location: #129
And this to access compiled classes: #72 (comment)

My understanding is that this lib is not fully compatible with ksp yet. Methods and properties like generatedFiles work fine for kapt, but for ksp you need a little duct tape ;).