Skip to content

Commit

Permalink
chore: Swap Kapt for KSP (#140)
Browse files Browse the repository at this point in the history
Update to KSP as it seems like the Kapt annotation processor no longer cuts it
  • Loading branch information
ThomasIent authored Dec 27, 2024
1 parent ce5ab5a commit f5b4382
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.google.services) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.ksp) apply false
}
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ mockito-android = "5.14.2" # https://github.com/mockito/mockito/releases
mockito-kotlin = "5.4.0" # https://github.com/mockito/mockito-kotlin/releases
# DI
dagger = "2.54" # https://github.com/google/dagger/releases
ksp = "2.1.0-1.0.29" # https://github.com/google/ksp/releases

[libraries]
# Gradle
Expand Down Expand Up @@ -58,3 +59,4 @@ detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt-gradle" }
google-services = { id = "com.google.gms.google-services", version.ref = "google-services" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-general" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint-gradle" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp"}
15 changes: 4 additions & 11 deletions modules/logging-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import uk.gov.pipelines.config.ApkConfig

plugins {
id("uk.gov.pipelines.android-lib-config")
alias(libs.plugins.ksp)
}

android {
Expand Down Expand Up @@ -89,21 +90,13 @@ dependencies {
testImplementation(dependency)
}

listOf(
libs.hilt.compiler,
).forEach {
kapt(it)
kaptTest(it)
kaptAndroidTest(it)
}
ksp(libs.hilt.compiler)
kspTest(libs.hilt.compiler)
kspAndroidTest(libs.hilt.compiler)

androidTestUtil(libs.androidx.orchestrator)
}

kapt {
correctErrorTypes = true
}

mavenPublishingConfig {
mavenConfigBlock {
name.set(
Expand Down
6 changes: 4 additions & 2 deletions modules/logging-impl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import uk.gov.pipelines.config.ApkConfig

plugins {
id("uk.gov.pipelines.android-lib-config")
alias(libs.plugins.ksp)
}

android {
Expand Down Expand Up @@ -90,8 +91,9 @@ dependencies {

androidTestUtil(libs.androidx.orchestrator)
api(projects.modules.loggingApi)
kapt(libs.hilt.compiler)
kaptAndroidTest(libs.hilt.compiler)
ksp(libs.hilt.compiler)
kspTest(libs.hilt.compiler)
kspAndroidTest(libs.hilt.compiler)
}

mavenPublishingConfig {
Expand Down
6 changes: 4 additions & 2 deletions modules/logging-testdouble/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import uk.gov.pipelines.config.ApkConfig

plugins {
id("uk.gov.pipelines.android-lib-config")
alias(libs.plugins.ksp)
}

android {
Expand Down Expand Up @@ -84,8 +85,9 @@ dependencies {

androidTestUtil(libs.androidx.orchestrator)
api(projects.modules.loggingApi)
kapt(libs.hilt.compiler)
kaptAndroidTest(libs.hilt.compiler)
ksp(libs.hilt.compiler)
kspTest(libs.hilt.compiler)
kspAndroidTest(libs.hilt.compiler)
}

mavenPublishingConfig {
Expand Down

0 comments on commit f5b4382

Please sign in to comment.