all: switch to moshi-kotlin and fix tests

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-12-17 13:27:13 +05:30
parent bca96ae215
commit 740d9e432a
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80
8 changed files with 12 additions and 12 deletions

View file

@ -7,10 +7,10 @@ plugins {
dependencies {
kapt(Dependencies.AndroidX.Hilt.daggerCompiler)
kapt(Dependencies.ThirdParty.Moshi.codegen)
api(Dependencies.ThirdParty.Retrofit.lib)
implementation(project(":database"))
implementation(Dependencies.AndroidX.Hilt.dagger)
implementation(Dependencies.ThirdParty.Moshi.kotlinReflect)
implementation(Dependencies.ThirdParty.Retrofit.moshi)
testImplementation(Dependencies.Kotlin.Coroutines.core)
testImplementation(Dependencies.Testing.junit)

View file

@ -1,6 +1,7 @@
package dev.msfjarvis.lobsters.injection
import com.squareup.moshi.Moshi
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
@ -11,6 +12,8 @@ import dagger.hilt.components.SingletonComponent
object MoshiModule {
@Provides
fun provideMoshi(): Moshi {
return Moshi.Builder().build()
return Moshi.Builder()
.add(KotlinJsonAdapterFactory())
.build()
}
}