An easy-to-use Kotlin DSL for building modules with the Guice dependency injection framework.
import dev.reifiedbeans.kava.getInstance
import dev.reifiedbeans.kava.kava
data class Message(val content: String)
fun main() {
val module = kava {
provide(Message::class) { Message("Hello, world!") }
}
val message = module.injector.getInstance(Message::class)
println(message.content)
}
For a more realistic example, take a look at the SimpleApplication example.
Licensed under the MIT License.