Annotations setup in multi-module Gradle architecture
Is your feature request related to a problem? Please describe. When using Koin Annotations in a multi-module Gradle architecture, we need to declare a Koin module per each individual Gradle module in order to pick up the components from that particular Gradle module. That means that even for Gradle modules that have simple setups with maybe only 1 component, we still need to manually declare a Koin module.
Describe the solution you'd like
In a similar architecture, Dagger doesn't require a separate Dagger module to be defined for each Gradle module. That simplifies the setup a lot, especially for projects with hundreds of Gradle modules. Would it be possible to automatically add components from any Gradle module to the defaultModule definition from the main Gradle module that calls the startKoin method?
Yes, this is something that could help
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
A simple step towards better multi-module experience would be to have a customizable module name with a sane default. The default module is not usable at all at the moment, because it is always generated as org.koin.ksp.generated.defaultModule. If it would be placed at <moduleName>.defaultModule instead, one could at least manually aggregate all default modules at app-level.
Ok I see
using app, usecases and data modules, i get this Type org.koin.ksp.generated.DefaultKt$defaultModule$1$1 is defined multiple times: C:\android\Paradigma\archetypes\compose-inital-kmm-libraries\usecases\build.transforms\0ee14af2934366395f0366a0ed59ee54\transformed\main\main_dex\org\koin\ksp\generated\DefaultKt$defaultModule$1$1.dex, C:\android\Paradigma\archetypes\compose-inital-kmm-libraries\data\build.transforms\ac83bc7ce413ddae3f62f35d4d21730b\transformed\main\main_dex\org\koin\ksp\generated\DefaultKt$defaultModule$1$1.dex
@fuentepa I also encountered this problem, which can be circumvented by setting KOIN_CONFIG_CHECK=false. You can refer to the official documentation https://insert-koin.io/docs/reference/koin-annotations/start#compile-safety---check-your- koin-config-at-compile-time-since-130
@fuentepa I also encountered this problem, which can be circumvented by setting KOIN_CONFIG_CHECK=false. You can refer to the official documentation https://insert-koin.io/docs/reference/koin-annotations/start#compile-safety---check-your- koin-config-at-compile-time-since-130
Maybe in this case it crash for that reason, but i get the same OP problem, when i have more modules using defaultmodule with anotations: that produce name colission between modules.
Multimodule scan is ready in https://github.com/InsertKoinIO/koin-annotations/issues/135 🎉