Hey everyone .. im new to Koin Annotations .. im planning on migrate my project to use annotations .. im heavily using multi module achitecture libraries for every feature and microservice .. and all those modules is compiled to AppModule
I have a scenario like this ..
I used to instantiate a Ktorfit module on AppModule/Parent module .. like this ..
val ktorfitModule = module {
single<Ktorfit> {
ktorfit {
// my config
}
}
}
then i used the ktorfit singleton in my child/service module like this
single<AuthService> {
val ktorfit : Ktorfit = get()
ktorfit.create()
}
and it works and compiled without any issue .. but when i try to do with annotations
AppModule
@Module(includes = [ServiceAuthModule::class])
@ComponentScan("com.ft.ats")
class AppModule {
@Single
fun getKtorfit(): Ktorfit {
return ktorfit {
// my config
}
}
}
Service Module
@Module
@ComponentScan("com.ats")
class ServiceAuthModule {
@Single
fun authService(ktorfit: Ktorfit) : AuthService = ktorfit.create()
@Single
fun getRepository(service: AuthService) : AuthRepository = AuthRepositoryImpl(service)
}
now its not compiled ..
im using this method both with Hilt and koin dsl without annotations and it has no problem ..
what am i missing ?