Skip to content

Commit

Permalink
Merge pull request #3101 from CruGlobal/daggerKsp
Browse files Browse the repository at this point in the history
Utilize KSP for Dagger where possible
  • Loading branch information
frett authored Sep 18, 2023
2 parents 27c2688 + 492c1d6 commit c233263
Show file tree
Hide file tree
Showing 22 changed files with 64 additions and 38 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ dependencies {
debugImplementation(libs.gtoSupport.okhttp3)
debugImplementation(libs.leakcanary)

// TODO: transition to KSP for dagger once referencing BuildConfig is supported
// see: https://github.com/google/dagger/issues/4051
kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)

Expand Down
4 changes: 2 additions & 2 deletions feature/bundledcontent/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("godtools.dynamic-feature-conventions")
kotlin("kapt")
alias(libs.plugins.ksp)
}

android.namespace = "org.cru.godtools.feature.bundledcontent"
Expand All @@ -12,5 +12,5 @@ dependencies {

implementation(libs.dagger)

kapt(libs.dagger.compiler)
ksp(libs.dagger.compiler)
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ androidx-compose-compiler = "1.5.3"
androidx-compose-material = "1.5.1"
androidx-compose-ui = "1.5.1"
androidx-core = "1.12.0"
androidx-hilt = "1.0.0"
androidx-hilt = "1.1.0-alpha01"
androidx-lifecycle = "2.6.2"
androidx-room = "2.5.2"
androidx-viewpager2 = "1.0.0"
Expand Down
6 changes: 3 additions & 3 deletions library/account/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("godtools.library-conventions")
kotlin("kapt")
alias(libs.plugins.ksp)
}

android.namespace = "org.cru.godtools.account"
Expand All @@ -25,8 +25,8 @@ dependencies {
implementation(libs.play.auth)
// endregion Google

kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)
ksp(libs.dagger.compiler)
ksp(libs.hilt.compiler)

testImplementation(kotlin("test"))
testImplementation(libs.kotlin.coroutines.test)
Expand Down
6 changes: 3 additions & 3 deletions library/analytics/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("godtools.library-conventions")
kotlin("kapt")
alias(libs.plugins.ksp)
}

android {
Expand Down Expand Up @@ -42,8 +42,8 @@ dependencies {
implementation(libs.play.tagmanager)
implementation(libs.weakdelegate)

kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)
ksp(libs.dagger.compiler)
ksp(libs.hilt.compiler)

testImplementation(kotlin("test"))
testImplementation(libs.kotlin.coroutines.test)
Expand Down
2 changes: 2 additions & 0 deletions library/api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ dependencies {
implementation(libs.scarlet.adapters.stream.coroutines)
implementation(libs.scarlet.websockets.okhttp)

// TODO: transition to KSP for dagger once referencing BuildConfig is supported
// see: https://github.com/google/dagger/issues/4051
kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)

Expand Down
7 changes: 4 additions & 3 deletions library/base/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("godtools.library-conventions")
kotlin("kapt")
alias(libs.plugins.ksp)
}

android.namespace = "org.cru.godtools.base"
Expand All @@ -23,8 +23,9 @@ dependencies {
implementation(libs.dagger)
implementation(libs.hilt)
implementation(libs.kotlin.coroutines)
kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)

ksp(libs.dagger.compiler)
ksp(libs.hilt.compiler)

testImplementation(libs.kotlin.coroutines.test)
testImplementation(libs.turbine)
Expand Down
6 changes: 2 additions & 4 deletions library/db/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id("godtools.library-conventions")
kotlin("kapt")
alias(libs.plugins.ksp)
}

Expand Down Expand Up @@ -37,10 +36,9 @@ dependencies {
implementation(libs.dagger)
implementation(libs.hilt)

kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)

ksp(libs.androidx.room.compiler)
ksp(libs.dagger.compiler)
ksp(libs.hilt.compiler)

testImplementation(kotlin("test"))
testImplementation(libs.androidx.room.testing)
Expand Down
9 changes: 5 additions & 4 deletions library/download-manager/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id("godtools.library-conventions")
kotlin("kapt")
alias(libs.plugins.ksp)
}

android {
Expand Down Expand Up @@ -39,13 +40,13 @@ dependencies {
implementation(libs.hilt)
implementation(libs.kotlin.coroutines)

kapt(libs.androidx.hilt.compiler)
kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)
ksp(libs.androidx.hilt.compiler)
ksp(libs.dagger.compiler)
ksp(libs.hilt.compiler)

testImplementation(libs.androidx.arch.core.testing)
testImplementation(libs.hilt.testing)
testImplementation(libs.kotlin.coroutines.test)
testImplementation(libs.turbine)
kaptTest(libs.hilt.compiler)
kspTest(libs.hilt.compiler)
}
4 changes: 2 additions & 2 deletions library/initial-content/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import org.cru.godtools.gradle.bundledcontent.configureBundledContent

plugins {
id("godtools.library-conventions")
kotlin("kapt")
alias(libs.plugins.ksp)
}

android {
Expand Down Expand Up @@ -46,5 +46,5 @@ dependencies {

testImplementation(libs.kotlin.coroutines.test)

kapt(libs.hilt.compiler)
ksp(libs.hilt.compiler)
}
8 changes: 4 additions & 4 deletions library/sync/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("godtools.library-conventions")
kotlin("kapt")
alias(libs.plugins.ksp)
}

android.namespace = "org.cru.godtools.sync"
Expand All @@ -27,7 +27,7 @@ dependencies {

testImplementation(libs.kotlin.coroutines.test)

kapt(libs.androidx.hilt.compiler)
kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)
ksp(libs.androidx.hilt.compiler)
ksp(libs.dagger.compiler)
ksp(libs.hilt.compiler)
}
6 changes: 3 additions & 3 deletions library/user-data/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("godtools.library-conventions")
kotlin("kapt")
alias(libs.plugins.ksp)
}

android.namespace = "org.cru.godtools.user"
Expand All @@ -17,8 +17,8 @@ dependencies {

implementation(libs.dagger)

kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)
ksp(libs.dagger.compiler)
ksp(libs.hilt.compiler)

testImplementation(kotlin("test"))
testImplementation(libs.kotlin.coroutines.test)
Expand Down
3 changes: 3 additions & 0 deletions ui/article-aem-renderer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ dependencies {
implementation(libs.splitties.fragmentargs)
implementation(libs.weakdelegate)

// TODO: transition to KSP for dagger once Data Binding is no longer used
// see: https://dagger.dev/dev-guide/ksp#interaction-with-javackapt-processors
// see: https://issuetracker.google.com/issues/173030256#comment10
kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)

Expand Down
3 changes: 3 additions & 0 deletions ui/article-renderer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ dependencies {
implementation(libs.hilt)
implementation(libs.splitties.fragmentargs)

// TODO: transition to KSP for dagger once Data Binding is no longer used
// see: https://dagger.dev/dev-guide/ksp#interaction-with-javackapt-processors
// see: https://issuetracker.google.com/issues/173030256#comment10
kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)

Expand Down
3 changes: 3 additions & 0 deletions ui/base-tool/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ dependencies {
implementation(libs.splitties.fragmentargs)
implementation(libs.youtubePlayer)

// TODO: transition to KSP for dagger once Data Binding is no longer used
// see: https://dagger.dev/dev-guide/ksp#interaction-with-javackapt-processors
// see: https://issuetracker.google.com/issues/173030256#comment10
kapt(libs.dagger.compiler)
kapt(libs.google.auto.value)
kapt(libs.hilt.compiler)
Expand Down
5 changes: 3 additions & 2 deletions ui/base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id("godtools.library-conventions")
kotlin("kapt")
alias(libs.plugins.hilt)
alias(libs.plugins.ksp)
}

android {
Expand Down Expand Up @@ -50,8 +51,8 @@ dependencies {
implementation(libs.hilt)
implementation(libs.youtubePlayer)

kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)
ksp(libs.dagger.compiler)
ksp(libs.hilt.compiler)

testImplementation(project(":ui:tract-renderer"))
}
3 changes: 3 additions & 0 deletions ui/cyoa-renderer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ dependencies {
implementation(libs.hilt)
implementation(libs.splitties.fragmentargs)

// TODO: transition to KSP for dagger once Data Binding is no longer used
// see: https://dagger.dev/dev-guide/ksp#interaction-with-javackapt-processors
// see: https://issuetracker.google.com/issues/173030256#comment10
kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)

Expand Down
3 changes: 3 additions & 0 deletions ui/lesson-renderer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ dependencies {
implementation(libs.materialComponents)
implementation(libs.splitties.fragmentargs)

// TODO: transition to KSP for dagger once Data Binding is no longer used
// see: https://dagger.dev/dev-guide/ksp#interaction-with-javackapt-processors
// see: https://issuetracker.google.com/issues/173030256#comment10
kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)

Expand Down
8 changes: 4 additions & 4 deletions ui/shortcuts/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id("godtools.library-conventions")
kotlin("kapt")
alias(libs.plugins.hilt)
alias(libs.plugins.ksp)
}

android {
Expand Down Expand Up @@ -36,7 +36,7 @@ dependencies {
testImplementation(libs.gtoSupport.testing.timber)
testImplementation(libs.kotlin.coroutines.test)

kapt(libs.androidx.hilt.compiler)
kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)
ksp(libs.androidx.hilt.compiler)
ksp(libs.dagger.compiler)
ksp(libs.hilt.compiler)
}
3 changes: 3 additions & 0 deletions ui/tips-renderer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ dependencies {
implementation(libs.hilt)
implementation(libs.splitties.fragmentargs)

// TODO: transition to KSP for dagger once Data Binding is no longer used
// see: https://dagger.dev/dev-guide/ksp#interaction-with-javackapt-processors
// see: https://issuetracker.google.com/issues/173030256#comment10
kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)

Expand Down
3 changes: 3 additions & 0 deletions ui/tract-renderer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ dependencies {
implementation(libs.tinder.statemachine)
implementation(libs.weakdelegate)

// TODO: transition to KSP for dagger once Data Binding is no longer used
// see: https://dagger.dev/dev-guide/ksp#interaction-with-javackapt-processors
// see: https://issuetracker.google.com/issues/173030256#comment10
kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)

Expand Down
6 changes: 3 additions & 3 deletions ui/tutorial-renderer/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id("godtools.library-conventions")
kotlin("kapt")
alias(libs.plugins.hilt)
alias(libs.plugins.ksp)
}

android {
Expand Down Expand Up @@ -46,6 +46,6 @@ dependencies {
implementation(libs.splitties.intents)
implementation(libs.youtubePlayer)

kapt(libs.dagger.compiler)
kapt(libs.hilt.compiler)
ksp(libs.dagger.compiler)
ksp(libs.hilt.compiler)
}

0 comments on commit c233263

Please sign in to comment.