Skip to content

Commit 74a8ce9

Browse files
authored
Merge pull request #286 from YAPP-Github/BOOK-520-chore/#285
[BOOK-520] chore: 네트워크 디버깅을 위한 Chucker 라이브러리 연동
2 parents 6226536 + 43154fc commit 74a8ce9

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

core/network/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,7 @@ dependencies {
3333
libs.kotlinx.coroutines.core,
3434
libs.logger,
3535
)
36+
37+
debugImplementation(libs.chucker)
38+
releaseImplementation(libs.chucker.no.op)
3639
}

core/network/src/main/kotlin/com/ninecraft/booket/core/network/di/NetworkGraph.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package com.ninecraft.booket.core.network.di
22

3+
import android.content.Context
34
import android.util.Log
5+
import com.chuckerteam.chucker.api.ChuckerInterceptor
6+
import com.ninecraft.booket.core.di.ApplicationContext
47
import com.ninecraft.booket.core.di.DataScope
58
import com.ninecraft.booket.core.network.BuildConfig
69
import com.ninecraft.booket.core.network.TokenAuthenticator
@@ -83,18 +86,27 @@ interface NetworkGraph {
8386
return interceptor
8487
}
8588

89+
@Provides
90+
fun provideChuckerInterceptor(
91+
@ApplicationContext context: Context,
92+
): ChuckerInterceptor {
93+
return ChuckerInterceptor(context)
94+
}
95+
8696
@Provides
8797
fun provideOkHttpClient(
8898
httpLoggingInterceptor: HttpLoggingInterceptor,
8999
tokenInterceptor: TokenInterceptor,
90100
tokenAuthenticator: TokenAuthenticator,
101+
chuckerInterceptor: ChuckerInterceptor,
91102
): OkHttpClient {
92103
return OkHttpClient.Builder()
93104
.connectTimeout(MaxTimeoutMillis, TimeUnit.MILLISECONDS)
94105
.readTimeout(MaxTimeoutMillis, TimeUnit.MILLISECONDS)
95106
.writeTimeout(MaxTimeoutMillis, TimeUnit.MILLISECONDS)
96107
.addInterceptor(tokenInterceptor)
97108
.authenticator(tokenAuthenticator)
109+
.addInterceptor(chuckerInterceptor)
98110
.addInterceptor(httpLoggingInterceptor)
99111
.build()
100112
}

gradle/libs.versions.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
minSdk = "28"
44
targetSdk = "36"
55
compileSdk = "36"
6-
versionName = "1.3.0"
7-
versionCode = "9"
6+
versionName = "1.4.0"
7+
versionCode = "11"
88
packageName = "com.ninecraft.booket"
99

1010
## Android gradle plugin
@@ -40,6 +40,7 @@ metro = "0.10.2"
4040
## Network
4141
okhttp = "5.3.2"
4242
retrofit = "3.0.0"
43+
chucker = "4.3.1"
4344

4445
## Circuit
4546
circuit = "0.32.0"
@@ -114,6 +115,8 @@ compose-keyboard-state = { group = "tech.thdev", name = "extensions-compose-keyb
114115
retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" }
115116
retrofit-kotlinx-serialization-converter = { module = "com.squareup.retrofit2:converter-kotlinx-serialization", version.ref = "retrofit" }
116117
okhttp-logging-interceptor = { group = "com.squareup.okhttp3", name = "logging-interceptor", version.ref = "okhttp" }
118+
chucker = { group = "com.github.chuckerteam.chucker", name = "library", version.ref = "chucker" }
119+
chucker-no-op = { group = "com.github.chuckerteam.chucker", name = "library-no-op", version.ref = "chucker" }
117120

118121
coil-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil-compose" }
119122
landscapist-bom = { group = "com.github.skydoves", name = "landscapist-bom", version.ref = "landscapist" }

0 commit comments

Comments
 (0)