Open
Description
Here is an example that I use:
val source = kotlin("source.kt", """
@se.ansman.kotshi.KotshiJsonAdapterFactory
object Factory : com.squareup.moshi.JsonAdapter.Factory by KotshiFactory
""".trimIndent()
)
val compilation = KotlinCompilation().apply {
workingDir = temporaryFolder.root
sources = listOf(source)
inheritClassPath = true
messageOutputStream = System.out // see diagnostics in real time
kspIncremental = true
symbolProcessorProviders = listOf(KotshiSymbolProcessorProvider())
}
assertThat(result.exitCode).isEqualTo(KotlinCompilation.ExitCode.OK)
val factory = result.classLoader.loadClass("KotshiFactory")
assertThat(factory).isAssignableTo(JsonAdapter.Factory::class.java)
This works fine when using the KAPT version of the processor and I have manually confirmed that the source is indeed generated.
Metadata
Metadata
Assignees
Labels
No labels