Getting Started¶
Installation¶
Android Modules¶
For pure Kotlin modules you need to add KSP, the auto-dagger android dependency, the auto-dagger compiler as well as the hilt dependencies:
plugins {
    id("com.google.devtools.ksp")
    id("com.google.dagger.hilt.android") // Optional, but recommended
}
dependencies {
    // For app modules add the android dependency
    implementation("se.ansman.dagger.auto:android:2.1.0")
    // And for library modules add the android-api dependency:
    implementation("se.ansman.dagger.auto:android-api:2.1.0")
    // Next add the compiler using KSP
    ksp("se.ansman.dagger.auto:compiler:2.1.0")
    // Add these if you want to replace objects during tests
    testImplementation("se.ansman.dagger.auto:android-testing:2.1.0")
    kspTest("se.ansman.dagger.auto:compiler:2.1.0")
    // If you haven't already, you need to add the Dagger dependencies
    implementation("com.google.dagger:hilt-android:2.57.2")
    ksp("se.ansman.dagger.auto:compiler:2.1.0")
}
Kotlin Modules¶
For pure Kotlin modules you need to add KSP, the auto-dagger core dependency, the auto-dagger compiler as well as the hilt dependencies:
plugins {
    id("com.google.devtools.ksp")
}
dependencies {
    implementation("se.ansman.dagger.auto:core:2.1.0")
    ksp("se.ansman.dagger.auto:compiler:2.1.0")
    // If you haven't already you need to add the Dagger dependencies
    implementation("com.google.dagger:hilt-core:2.57.2")
    ksp("com.google.dagger:hilt-compiler:2.57.2")
}
Snapshots¶
Snapshots are published on every commit to Sonatype's snapshot repository. To use a snapshot add the snapshot repository: