Merge Component
annotation class MergeComponent(val scope: KClass<*>, val modules: Array<KClass<*>> = [], val dependencies: Array<KClass<*>> = [], val exclude: Array<KClass<*>> = [])
Dagger components that should automatically include Dagger modules and component interfaces for the given scope require this annotation instead of @Component. The Kotlin compiler plugin will add the @Component annotation to this interface. The parameters modules and dependencies are preserved in the @Component annotation.
@MergeComponent(AppScope::class)
interface AppComponentContent copied to clipboard
It's possible to exclude any automatically added Dagger module or component interface with the exclude parameter if needed.
@MergeComponent(
scope = AppScope::class,
exclude = [
DaggerModule::class,
ComponentInterface::class
]
)
interface AppComponentContent copied to clipboard