Skip to content

KiteThe graph is inferred, not declared

Dependency injection for Android with no annotations and no modules. You write plain classes; the KSP processor reads what the code already says, and every Dagger-style guarantee is checked at compile time.

Kite

The whole idea, in one file ​

kotlin
interface UserRepo { fun userName(): String }

class RealUserRepo(api: Api, db: Db) : UserRepo   // that's it. no annotation.

RealUserRepo is the sole implementation of a project interface, so it is the binding for UserRepo. Its constructor parameters are its dependencies. It is one shared instance app-wide, because everything in the graph is a singleton by default. It is a node on the board.

Nothing above is a framework concept you had to learn. That is the point.

The Kite board showing the demo app's graph

Install ​

kotlin
// build.gradle.kts of every module with injectable classes
plugins {
    alias(libs.plugins.android.application)
    id("com.kitedi") version "0.1.1"
}

One plugin id replaces the KSP block, the processor dependency and the runtime dependency in every module. Two more lines go in settings.gradle.kts and the root build file once. Full setup →

Released under the Apache 2.0 License.