Closed eygraber closed 3 months ago
@evant any thoughts on this?
I added a processor to my project that generates actual functions that call the target create function - https://github.com/eygraber/immich-kmp/blob/e5aa43231926962dd23f228a55bcd49514e7cd2e/ksp/generate-actual-compiler/src/main/kotlin/app/immich/kmp/ksp/generate/actual/GenerateProcessorProvider.kt
The usage looks like:
@GenerateActual
internal expect fun MainHostComponent.Companion.createKmp(
sessionComponent: ImmichSessionComponent,
route: Route,
): MainHostComponent
which generates:
@GenerateActual
internal actual fun MainHostComponent.Companion.createKmp(
sessionComponent: ImmichSessionComponent,
route: Route
): MainHostComponent = MainHostComponent.Companion.create(sessionComponent, route)
sorry taking a long time to reply, this really feels like a giant hack which makes me hesitant to do something about it. I do like your additional processor solution better than an extra flag though.
I can make a new PR using the additional processor idea.
Any thoughts on what the new annotation could be called? I used GenerateActual
as a placeholder, but I don't think that's good to release.
Closing because of https://github.com/evant/kotlin-inject/pull/370
Fixes #361