Use moshi-metadata-reflect

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya
2021-04-23 10:07:44 +05:30
parent 0675a6addb
commit eec16bdfbd
4 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ plugins {
dependencies {
api(libs.thirdparty.retrofit.lib)
ksp(libs.thirdparty.moshi.ksp)
ksp(libs.thirdparty.moshix.ksp)
implementation(libs.thirdparty.retrofit.moshiConverter)
testImplementation(libs.kotlin.coroutines.core)
testImplementation(libs.testing.kotlintest.junit)
+1
View File
@@ -48,6 +48,7 @@ dependencies {
implementation(libs.thirdparty.accompanist.flow)
implementation(libs.thirdparty.accompanist.swiperefresh)
implementation(libs.thirdparty.moshi.lib)
implementation(libs.thirdparty.moshix.metadatareflect)
implementation(libs.thirdparty.retrofit.moshiConverter)
testImplementation(libs.testing.kotlintest.junit)
androidTestImplementation(libs.testing.kotlintest.junit)
@@ -6,6 +6,7 @@ import dagger.Provides
import dagger.Reusable
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import dev.zacsweers.moshix.reflect.MetadataKotlinJsonAdapterFactory
@Module
@InstallIn(SingletonComponent::class)
@@ -13,6 +14,8 @@ object MoshiModule {
@Provides
@Reusable
fun provideMoshi(): Moshi {
return Moshi.Builder().build()
return Moshi.Builder()
.add(MetadataKotlinJsonAdapterFactory())
.build()
}
}
+3 -1
View File
@@ -9,6 +9,7 @@ jb_compose = "0.4.0-build184"
kotlin = "1.4.32"
ksp = "1.4.32-1.0.0-alpha08"
lifecycle = "2.4.0-alpha01"
moshix = "0.10.0"
retrofit = "2.9.0"
sqldelight = "1.4.4"
@@ -56,7 +57,8 @@ thirdparty-pullToRefresh = "com.puculek.pulltorefresh:pull-to-refresh-compose:1.
# Moshi dependencies
thirdparty-moshi-lib = "com.squareup.moshi:moshi:1.12.0"
thirdparty-moshi-ksp = "dev.zacsweers.moshix:moshi-ksp:0.10.0"
thirdparty-moshix-ksp = { module = "dev.zacsweers.moshix:moshi-ksp", version.ref = "moshix" }
thirdparty-moshix-metadatareflect = { module = "dev.zacsweers.moshix:moshi-metadata-reflect", version.ref = "moshix" }
# Retrofit dependencies
thirdparty-retrofit-lib = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }