Describe the bug
As the title Koin Annotation implies, in a Kotlin Multiplatform project Koin Annotation fails to generate the default Module for classes without package declaration in the Kotlin folder.
To Reproduce
Steps to reproduce the behavior:
Setup Koin Annotations in a basic KMP project with Android and iOS target (probably doesn't matter)
Create the SampleClass you can see above in the kotlin package:
import org.koin.core.annotation.Single
@Single
class SampleClass
Execute the Koin KSP compiler process / build the project
Expected behavior
The Default.kt should properly contain the SampleClass definition
Actual behavior
The build fails because the generated Default.kt file looks like the following:
package org.koin.ksp.generated
import org.koin.core.KoinApplication
import org.koin.core.module.Module
import org.koin.dsl.*
public fun KoinApplication.defaultModule(): KoinApplication = modules(defaultModule)
public val defaultModule : Module = module {
single() { .SampleClass() }
}
As you can see it adds a . in front of the SampleClass which causes a syntax error.
Observation
When I add an additional folder into the ../koin folder like ../koin/example/ in which I move the SampleClass, the Default.kt file gets properly generated.
Describe the bug As the title Koin Annotation implies, in a Kotlin Multiplatform project Koin Annotation fails to generate the default Module for classes without package declaration in the Kotlin folder.
To Reproduce Steps to reproduce the behavior:
Setup Koin Annotations in a basic KMP project with Android and iOS target (probably doesn't matter)
Have the following package structure in the
commonMain
module (so you place your files simply in../kotlin
like for example in the Compose Multiplatform for iOS and Android template project:Create the
SampleClass
you can see above in thekotlin
package:Execute the Koin KSP compiler process / build the project
Expected behavior The
Default.kt
should properly contain theSampleClass
definitionActual behavior The build fails because the generated
Default.kt
file looks like the following:As you can see it adds a
.
in front of theSampleClass
which causes a syntax error.Observation When I add an additional folder into the
../koin
folder like../koin/example/
in which I move theSampleClass
, theDefault.kt
file gets properly generated.Koin module and version: