Providing these classes out of the box will standardize them across projects and make onboarding of kotlin-inject-anvil easier.
The code for all platforms except JVM would look roughly like this:
@Scope
annotation class SingleIn(val scope: KClass<*>)
@Qualifier
annotation class ForScope(val scope: KClass<*>)
abstract class private constructor() AppScope
For JVM based platforms (including Android) we'd mark the annotations with JSR-330 annotation as well, so that they can be reused for Dagger 2 and Anvil to improve compatibility and ease migrations. JSR-330 would be added as compileOnly dependency and not exposed downstream. To support that we'd rely on expect - actual annotation classes.
1 is a blocker for this issue.
Providing these classes out of the box will standardize them across projects and make onboarding of
kotlin-inject-anvil
easier.The code for all platforms except JVM would look roughly like this:
For JVM based platforms (including Android) we'd mark the annotations with JSR-330 annotation as well, so that they can be reused for Dagger 2 and Anvil to improve compatibility and ease migrations. JSR-330 would be added as
compileOnly
dependency and not exposed downstream. To support that we'd rely on expect - actual annotation classes.