-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a57637a
commit 42bff64
Showing
4 changed files
with
53 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...ect/src/main/kotlin/ru/pixnews/anvil/codegen/initializer/inject/ContributesInitializer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2024, the pixnews-anvil-codegen project authors and contributors. | ||
* Please see the AUTHORS file for details. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
*/ | ||
|
||
package ru.pixnews.anvil.codegen.initializer.inject | ||
|
||
import kotlin.annotation.AnnotationTarget.CLASS | ||
import kotlin.reflect.KClass | ||
|
||
/** | ||
* 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. | ||
* | ||
* @property replaces 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. | ||
*/ | ||
@Target(CLASS) | ||
public annotation class ContributesInitializer( | ||
val replaces: Array<KClass<*>> = [], | ||
) |
9 changes: 9 additions & 0 deletions
9
...rc/main/kotlin/ru/pixnews/anvil/codegen/initializer/inject/wiring/AppInitializersScope.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright (c) 2024, the pixnews-anvil-codegen project authors and contributors. | ||
* Please see the AUTHORS file for details. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
*/ | ||
|
||
package ru.pixnews.anvil.codegen.initializer.inject.wiring | ||
|
||
public abstract class AppInitializersScope private constructor() |