Skip to content

Commit

Permalink
Migrate moshi to KSP
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rken committed Sep 14, 2024
1 parent af9dbf2 commit d16c6fc
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 7 deletions.
3 changes: 2 additions & 1 deletion app-common-io/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("kotlin-android")
id("kotlin-kapt")
id("kotlin-parcelize")
id("com.google.devtools.ksp")
id("kotlin-kapt")
id("projectConfig")
}

Expand Down
3 changes: 2 additions & 1 deletion app-common-root/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("kotlin-android")
id("kotlin-kapt")
id("kotlin-parcelize")
id("com.google.devtools.ksp")
id("kotlin-kapt")
id("projectConfig")
}

Expand Down
3 changes: 2 additions & 1 deletion app-common-shizuku/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("kotlin-android")
id("kotlin-kapt")
id("kotlin-parcelize")
id("com.google.devtools.ksp")
id("kotlin-kapt")
id("projectConfig")
}

Expand Down
1 change: 1 addition & 0 deletions app-common-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("kotlin-android")
id("com.google.devtools.ksp")
id("kotlin-kapt")
id("projectConfig")
}
Expand Down
3 changes: 2 additions & 1 deletion app-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("kotlin-android")
id("kotlin-kapt")
id("kotlin-parcelize")
id("com.google.devtools.ksp")
id("kotlin-kapt")
id("projectConfig")
}

Expand Down
3 changes: 3 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id("kotlin-android")
id("kotlin-parcelize")
id("projectConfig")
id("com.google.devtools.ksp")
id("kotlin-kapt")
}
apply(plugin = "dagger.hilt.android.plugin")
Expand Down Expand Up @@ -206,6 +207,8 @@ dependencies {
androidTestImplementation("androidx.navigation:navigation-testing:${Versions.AndroidX.Navigation.core}")




testImplementation("org.robolectric:robolectric:4.9.1")
testImplementation("androidx.test.ext:junit:1.1.4")
}
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("projectConfig")
id("com.google.devtools.ksp") version "1.9.25-1.0.20" apply false
}

buildscript {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ repositories {
}
dependencies {
implementation("com.android.tools.build:gradle:8.4.2")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.24")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25")
implementation("com.squareup:javapoet:1.13.0")
}
5 changes: 4 additions & 1 deletion buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ private fun DependencyHandler.testImplementation(dependencyNotation: Any): Depen
private fun DependencyHandler.kapt(dependencyNotation: Any): Dependency? =
add("kapt", dependencyNotation)

private fun DependencyHandler.ksp(dependencyNotation: Any): Dependency? =
add("ksp", dependencyNotation)

private fun DependencyHandler.kaptTest(dependencyNotation: Any): Dependency? =
add("kaptTest", dependencyNotation)

Expand Down Expand Up @@ -75,7 +78,7 @@ fun DependencyHandlerScope.addSerialization() {
val version = "1.15.1"
implementation("com.squareup.moshi:moshi:$version")
implementation("com.squareup.moshi:moshi-adapters:$version")
kapt("com.squareup.moshi:moshi-kotlin-codegen:$version")
add("ksp", "com.squareup.moshi:moshi-kotlin-codegen:$version")
}

fun DependencyHandlerScope.addIO() {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
object Versions {
object Kotlin {
const val core = "1.9.24"
const val core = "1.9.25"
const val coroutines = "1.8.0"
}

Expand Down

0 comments on commit d16c6fc

Please sign in to comment.