Open Coolmanakov opened 2 years ago
See this for file location: https://github.com/tschuchortdev/kotlin-compile-testing/issues/129 And this to access compiled classes: https://github.com/tschuchortdev/kotlin-compile-testing/issues/72#issuecomment-744475289
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 ;).
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 https://github.com/tschuchortdev/kotlin-compile-testing/issues/129