Skip to content

Commit e128eed

Browse files
authored
Move Kotlin serialization gradle plugin into libs.versions.toml (#6254)
A previous change, #6186, added the Kotlin serialization plugin to every single Gradle module; however, only one module actually used it. Moreover, it is becoming more conventional to define dependency versions in `gradle/libs.versions.toml`. This PR removes the global dependency on the Kotlin serialization plugin and, instead, moves the version into `gradle/libs.versions.toml`, and also modifies the dependency on the Kotlin JSON serialization library to use `gradle/libs.versions.toml`. This will make sure that every module uses the same version, which will become important once Data Connect, which also uses these libraries, is merged into main.
1 parent 27a16a1 commit e128eed

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ buildscript {
4141
classpath 'com.google.firebase:firebase-appdistribution-gradle:5.0.0'
4242
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.5'
4343
classpath "com.diffplug.spotless:spotless-plugin-gradle:7.0.0.BETA1"
44-
classpath "org.jetbrains.kotlin:kotlin-serialization:1.8.22"
4544
}
4645
}
4746

firebase-vertexai/firebase-vertexai.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
plugins {
2020
id("firebase-library")
2121
id("kotlin-android")
22-
kotlin("plugin.serialization")
22+
alias(libs.plugins.kotlinx.serialization)
2323
}
2424

2525
firebaseLibrary {
@@ -71,7 +71,7 @@ dependencies {
7171
implementation("com.google.firebase:firebase-annotations:16.2.0")
7272
implementation("com.google.firebase:firebase-appcheck-interop:17.1.0")
7373
implementation(libs.androidx.annotation)
74-
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
74+
implementation(libs.kotlinx.serialization.json)
7575
implementation("androidx.core:core-ktx:1.12.0")
7676
implementation("org.slf4j:slf4j-nop:2.0.9")
7777
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")

gradle/libs.versions.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dagger = "2.43.2"
88
grpc = "1.62.2"
99
javalite = "3.21.11"
1010
kotlin = "1.8.22"
11+
serialization-plugin = "1.8.22"
1112
protoc = "3.21.11"
1213
truth = "1.4.2"
1314
robolectric = "4.12"
@@ -36,7 +37,7 @@ findbugs-jsr305 = { module = "com.google.code.findbugs:jsr305", version = "3.0.2
3637
javax-inject = { module = "javax.inject:javax.inject", version = "1" }
3738
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
3839
kotlin-coroutines-tasks = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services", version.ref = "coroutines" }
39-
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.5.0" }
40+
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.5.1" }
4041
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
4142
okhttp = { module = "com.squareup.okhttp3:okhttp", version = "3.12.13" }
4243
org-json = { module = "org.json:json", version = "20210307" }
@@ -65,3 +66,6 @@ quickcheck = { module = "net.java:quickcheck", version.ref = "quickcheck" }
6566
[bundles]
6667
kotest = ["kotest-runner", "kotest-assertions", "kotest-property"]
6768
playservices = ["playservices-base", "playservices-basement", "playservices-tasks"]
69+
70+
[plugins]
71+
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "serialization-plugin" }

0 commit comments

Comments
 (0)