Christopher Porto
10/10/2022, 5:30 AM@Single
annotation on a function? The annotation has function as a target, but when I try creating a top level function to provide singleton, generated code doesnt include itarnaud.giuliani
10/10/2022, 5:08 PMChristopher Porto
10/10/2022, 5:37 PMMantas Varnagiris
01/30/2023, 8:35 PMstartKoin
. If @Single @Factory and other annotations would work on any top level functions then I don't need to write anything extra. Am I missing something?Christopher Porto
01/30/2023, 9:38 PM@Single
and @Factory
annotations worked on top level functions but they didn't (Not sure if that's still the case but most likely not). The annotated functions were only picked up by the processor when inside a class annotated as @Module
.
Also as far as I know it's not possible to have components generate in module A from a dependent project module B. Ksp scanning seems to happen per project module basis and if no koin module is defined it creates one for you. Think your best bet is creating module classes for your project modules and then including them in your main @Module
annotation or in startKoin
Of course @arnaud.giuliani probably has more insight on this 😛Mantas Varnagiris
01/30/2023, 9:52 PMarnaud.giuliani
01/31/2023, 7:55 AMThe annotated functions were only picked up by the processor when inside a class annotated asyes, improvement are coming for this 👍.@Module
Ksp scanning seems to happen per project module basis and if no koin module is defined it creates one for you. Think your best bet is creating module classes for your project modules and then including them in your mainExact 👌 For now, KSP Annotation scanning is done on the current Gradle moduleannotation or in@Module
startKoin
Mantas Varnagiris
01/31/2023, 9:15 AM