Skip to content

Commit

Permalink
Add hilt + support compose navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
sirambd committed Aug 23, 2024
1 parent 3c8f2f6 commit e3bf3e1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.kapt)
alias(libs.plugins.hilt)
kotlin("plugin.serialization") version libs.versions.kotlin
}

Expand Down Expand Up @@ -52,6 +54,10 @@ android {
}
}

kapt {
correctErrorTypes = true
}

dependencies {
implementation(kotlin("reflect"))

Expand All @@ -76,6 +82,11 @@ dependencies {
implementation(libs.compose.ui.tooling.preview)
debugImplementation(libs.compose.ui.tooling)

// Hilt
implementation(libs.hilt.android)
kapt(libs.hilt.android.compiler)
implementation(libs.hilt.navigation.compose)

// Others
implementation(libs.kotlinx.serialization)

Expand Down
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.kapt) apply false
alias(libs.plugins.hilt) apply false
}
8 changes: 7 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ agp = "8.5.2"
composeBom = "2024.06.00"
constraintlayoutCompose = "1.0.1"
coreKtx = "1.13.1"
hilt = "2.52"
hiltNavigationCompose = "1.2.0"
junit = "4.13.2"
junitVersion = "1.2.1"
kotlin = "2.0.10"
kotlin = "2.0.20"
lifecycleRuntimeKtx = "2.8.4"
material3Beta = "1.3.0-beta05"
Expand All @@ -29,6 +30,9 @@ compose-ui = { group = "androidx.compose.ui", name = "ui" }
compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt" }
hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "hiltNavigationCompose" }
kotlinx-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }
navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation" }
# Tests
Expand All @@ -38,4 +42,6 @@ junit = { group = "junit", name = "junit", version.ref = "junit" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

0 comments on commit e3bf3e1

Please sign in to comment.