groovy
dependencies {
implementation 'com.github.kohesive:injekt-core:3.0.0'
implementation 'com.github.kohesive:injekt-jvm:3.0.0'
implementation 'com.github.kohesive:injekt-companion-object-registry:3.0.0'
}
kotlin
@Singleton
class Service {
// ...
}
kotlin
class AnotherClass {
private val service: Service by inject()
// ...
}
kotlin
fun main() {
InjektConfigurator().configure()
}