Skip to content

Instantly share code, notes, and snippets.

@benigumocom
Last active January 23, 2025 07:02
Show Gist options
  • Save benigumocom/cc1ef3c0f32cfe194562349d6cf70aac to your computer and use it in GitHub Desktop.
Save benigumocom/cc1ef3c0f32cfe194562349d6cf70aac to your computer and use it in GitHub Desktop.
Dagget-Hilt + KSP | build.gradle.kts 👉 https://android.benigumo.com/20231104/hilt-ksp/
// Project
plugins {
alias(libs.plugins.ksp) apply false
alias(libs.plugins.hilt) apply false
}
// Module
plugins {
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
}
dependencies {
ksp(libs.hilt.android.compiler)
implementation(libs.hilt.android)
// kspAndroidTest(libs.hilt.android.compiler)
// androidTestImplementation(libs.hilt.android.testing)
}
[versions]
android-gradle-plugin = "8.1.2"
kotlin = "1.9.10"
ksp = "1.9.10-1.0.13"
hilt = "2.48.1"
[plugins]
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
[libraries]
hilt-android-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hilt" }
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
# hilt-android-testing = { group = "com.google.dagger", name = "hilt-android-testing", version.ref = "hilt" }
@lazy-pr0grammer
Copy link

thanks buddy you saved my time haha same kotlin version

@Colorfulnia
Copy link

Thanks.

@nixoncode
Copy link

nixoncode commented Jul 17, 2024

thanks buddy you saved my time haha same kotlin version @lazy-pr0grammer

way to live up to your name?

@Khazbs
Copy link

Khazbs commented Jul 27, 2024

Finally, all the KSP + Hilt dependencies in one place. Very good, thanks!

@lazy-pr0grammer
Copy link

thanks buddy you saved my time haha same kotlin version @lazy-pr0grammer

way to live up to your name?

You can

@ihebhm
Copy link

ihebhm commented Jul 30, 2024

Life saver 🙏

@k-arabadzhiev
Copy link

hilt-android-compiler will be deprecated in the future, replace with hilt-compiler: https://github.com/google/dagger/releases/tag/dagger-2.29.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment