ContributesTo

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

Contributes the annotated interface to the given scope. This is only applicable to interfaces. The downstream merged graph of the same scope will extend this interface in its implementation.

@ContributesTo(AppScope::class)
interface SomeDependencies {
val httpClient: HttpClient
}

// Later graph will extend it automatically
@DependencyGraph(AppScope::class)
interface AppGraph

Properties

Link copied to clipboard

List of interface types that this interface replaces in the scope.

Link copied to clipboard
val scope: KClass<*>

The scope this interface contributes to.