ContributesInitializer

@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class ContributesInitializer(val replaces: Array<KClass<*>> = [])(source)

Annotate a Initializer / AsyncInitializer class with this to automatically contribute it to the Initializer multibinding. Equivalent to the following declaration in an application module:

@Module
@ContributesTo(AppInitializersScope::class)
abstract class ExperimentModule {
@Binds @IntoSet
abstract fun bindMainExperiment(initializer: MainInitializer): Initializer
}

The generated code created via the anvil-codegen module.

Properties

Link copied to clipboard

This contributed module will replace these contributed classes. The array is allowed to include other contributed bindings, multibindings and Dagger modules. All replaced classes must use the same scope.