https://kotlinlang.org logo
#koin
Title
# koin
j

Joel Denke

03/19/2024, 6:39 PM
When using Koin annotations. Is it possible using module scan to declare all modules in app module scanning all child modules? Or do I have to create a @Module inside all modules and consume them from app where load modules?
s

segunfamisa

03/20/2024, 2:55 PM
I don’t know if koin will auto discover child modules via scanning. But i usually manually register child modules like this -
@Module(includes = [MyChildModule::class]
j

Joel Denke

03/20/2024, 4:37 PM
Yeah it didnt work using includes. It was so bad I went back to Hilt. I dont have time investigate or wait for koin supporting this. To bad.
I think similar to installIn(SingletonComponent) needed in Koin annotations. But also its same as dagger soon so.
s

segunfamisa

03/21/2024, 6:41 PM
Or do I have to create a @Module inside all modules and consume them from app where load modules?
Oh are you talking about gradle modules? If yes, it's something I ran into here