Last active
August 26, 2024 17:08
-
-
Save benigumocom/b5fa94749aef302fdb09089f6ba0dfc8 to your computer and use it in GitHub Desktop.
Hilt + kapt → KSP https://android.benigumo.com/20231104/hilt-ksp/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hilt + KSP | |
// build.gradle.kts (Project) | |
plugins { | |
id("com.google.devtools.ksp") version "1.8.10-1.0.9" apply false | |
id("com.google.dagger.hilt.android") version "2.44" apply false | |
} | |
// build.gradle.kts (Module) | |
plugins { | |
id("com.google.devtools.ksp") | |
id("com.google.dagger.hilt.android") | |
} | |
dependencies { | |
implementation("com.google.dagger:hilt-android:2.44") | |
ksp("com.google.dagger:hilt-android-compiler:2.44") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I thank benigumocom very much for his great contribution. In a very respectful way I want to leave the following contribution for all of us who use the versions catalog.
In the file
libs.versions.toml
, section[versions]
, addhilt = "2.51"
Taking into account that the version ofkotlin
would be in2.0.20
andksp
in2.0 .20-1.0.24
.In the
[libraries]
section registergoogle-hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
andhilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" }
In the
[plugins]
section addhilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
,ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
remaining as follows:In
build.gradle.kts
file at module level, It would look like this:In the
build.gradle.kts
file at the project level, it would look like this:That would be my contribution in a respectful way.