Skip to content

Commit 0372176

Browse files
committed
[chore] update Gradle and Kotlin dependencies; migrate from kapt to ksp [#134]
1 parent bbecbe5 commit 0372176

File tree

5 files changed

+63
-45
lines changed

5 files changed

+63
-45
lines changed

build.gradle.kts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ plugins {
55
alias(libs.plugins.android.library) apply false
66

77
alias(libs.plugins.hilt) apply false
8-
alias(libs.plugins.kotlin.kapt) apply false
8+
alias(libs.plugins.kotlin.ksp) apply false
9+
alias(libs.plugins.kotlin.compose) apply false
910
}
1011

1112
subprojects {
@@ -26,16 +27,11 @@ subprojects {
2627
}
2728

2829
compileOptions {
29-
sourceCompatibility = JavaVersion.VERSION_17
30-
targetCompatibility = JavaVersion.VERSION_17
30+
sourceCompatibility = JavaVersion.VERSION_21
31+
targetCompatibility = JavaVersion.VERSION_21
3132
}
3233
}
3334

34-
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
35-
kotlinOptions {
36-
jvmTarget = "17"
37-
}
38-
}
3935
}
4036

4137
// settings for application
@@ -90,16 +86,16 @@ subprojects {
9086
}
9187

9288
plugins.withId("org.jetbrains.kotlin.android") {
93-
apply(plugin = "kotlin-kapt")
89+
apply(plugin = "com.google.devtools.ksp")
9490
apply(plugin = "dagger.hilt.android.plugin")
9591

9692
dependencies {
9793
add("implementation", libs.hilt)
98-
add("kapt", libs.hilt.compiler)
94+
add("ksp", libs.hilt.compiler)
9995
}
10096

101-
configure<org.jetbrains.kotlin.gradle.plugin.KaptExtension> {
102-
correctErrorTypes = true
97+
configure<com.google.devtools.ksp.gradle.KspExtension> {
98+
arg("correctErrorTypes", "true")
10399
}
104100
}
105101

data/build.gradle.kts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
import org.gradle.internal.extensions.stdlib.capitalized
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
14
plugins {
25
alias(libs.plugins.android.library)
36
alias(libs.plugins.jetbrains.kotlin.android)
47
alias(libs.plugins.protobuf)
8+
alias(libs.plugins.kotlin.ksp)
59
}
610

711
android {
@@ -23,13 +27,25 @@ protobuf {
2327
}
2428
}
2529

30+
androidComponents {
31+
onVariants(selector().all()) { variant ->
32+
afterEvaluate {
33+
val capName = variant.name.capitalized()
34+
tasks.getByName<KotlinCompile>("ksp${capName}Kotlin") {
35+
setSource(tasks.getByName("generate${capName}Proto").outputs)
36+
}
37+
}
38+
}
39+
}
40+
2641
dependencies {
2742
// work manager
2843
implementation(libs.androidx.work.runtime.ktx)
2944
implementation(libs.androidx.hilt.work)
45+
ksp(libs.hilt.compiler)
3046

3147
// room
32-
kapt(libs.androidx.room.compiler)
48+
ksp(libs.androidx.room.compiler)
3349
implementation(libs.androidx.room.runtime)
3450
implementation(libs.androidx.room.ktx)
3551

@@ -52,6 +68,7 @@ dependencies {
5268
// camerax
5369
implementation(libs.camerax.core)
5470
// test
71+
kspAndroidTest(libs.hilt.compiler)
5572
testImplementation(libs.junit)
5673
androidTestImplementation(libs.androidx.junit)
5774

gradle/libs.versions.toml

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,72 +5,75 @@ app-version-code = "2"
55
app-version-name = "1.1.0"
66

77
# sdk ------------
8-
sdk-compile = "android-35"
8+
sdk-compile = "android-36"
99
sdk-min = "31"
10-
sdk-target = "35"
10+
sdk-target = "36"
1111

1212
# gradle ---------
13-
agp = "8.5.2"
13+
agp = "8.12.1"
1414

1515
# kotlin ---------
16-
kotlin = "1.9.20"
17-
coreKtx = "1.15.0"
16+
kotlin = "2.1.10"
17+
coreKtx = "1.17.0"
1818

1919
# kapt -----------
20-
kotlin-kapt = "1.9.20"
20+
kotlin-kapt = "2.1.10"
21+
22+
# ksp -----------
23+
ksp = "2.1.10-1.0.31"
2124

2225
# android --------
23-
appcompat = "1.7.0"
26+
appcompat = "1.7.1"
2427
composeCompiler = "1.5.5"
25-
lifecycle-runtime-ktx = "2.8.7"
26-
activity-compose = "1.9.3"
27-
compose-bom = "2024.12.01"
28+
lifecycle-runtime-ktx = "2.9.4"
29+
activity-compose = "1.10.1"
30+
compose-bom = "2025.07.00"
2831
material = "1.12.0"
29-
navigation-compose = "2.8.5"
32+
navigation-compose = "2.9.4"
3033

3134
# hilt -----------
32-
hilt = "2.49"
35+
hilt = "2.57.1"
3336
androidx-hilt-compiler = "1.2.0"
3437
androidx-hilt-navigation-compose = "1.2.0"
3538
androidx-hilt-work = "1.2.0"
3639

3740
# room -----------
38-
room = "2.6.1"
41+
room = "2.8.0"
3942

4043
# work manager ---
41-
work-runtime-ktx = "2.10.0"
44+
work-runtime-ktx = "2.10.4"
4245

4346
# retrofit -------
44-
okhttp = "4.12.0"
45-
retrofit = "2.9.0"
46-
gson = "2.10.1"
47+
okhttp = "5.1.0"
48+
retrofit = "3.0.0"
49+
gson = "2.13.2"
4750

4851
# serialization --
49-
serialization-json = "1.5.1"
52+
serialization-json = "1.9.0"
5053
serialization-converter = "1.0.0"
5154

5255
# proto datastore
53-
datastore = "1.1.1"
54-
protobuf = "3.23.2"
55-
protobuf-plugin = "0.9.4"
56-
protoc = "com.google.protobuf:protoc:4.28.2"
56+
datastore = "1.1.7"
57+
protobuf = "4.32.1"
58+
protobuf-plugin = "0.9.5"
59+
protoc = "com.google.protobuf:protoc:4.32.1"
5760

5861
# compose extended UI
59-
constraint-layout-compose = "1.1.0"
62+
constraint-layout-compose = "1.1.1"
6063
android-mjpeg-view = "1.1.3"
61-
material-icons-extended = "1.7.6"
62-
ui-graphics-android = "1.7.6"
64+
material-icons-extended = "1.7.8"
65+
ui-graphics-android = "1.9.1"
6366

6467
# qrcode-kotlin --
65-
qrcode-kotlin = "4.1.1"
68+
qrcode-kotlin = "4.5.0"
6669

6770
# camerax --------
68-
camerax = "1.4.1"
71+
camerax = "1.5.0"
6972

7073
# test -----------
7174
junit = "4.13.2"
72-
junit-version = "1.2.1"
73-
espresso-core = "3.6.1"
75+
junit-version = "1.3.0"
76+
espresso-core = "3.7.0"
7477
coilCompose = "2.7.0"
7578

7679

@@ -155,9 +158,10 @@ android-application = { id = "com.android.application", version.ref = "agp" }
155158
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
156159
android-library = { id = "com.android.library", version.ref = "agp" }
157160
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin-kapt"}
158-
161+
kotlin-ksp = { id = "com.google.devtools.ksp", version.ref = "ksp"}
159162
# hilt -----------
160163
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt"}
161164

162165
# proto datastore
163-
protobuf = { id = "com.google.protobuf", version.ref = "protobuf-plugin" }
166+
protobuf = { id = "com.google.protobuf", version.ref = "protobuf-plugin" }
167+
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Fri Sep 20 14:42:01 KST 2024
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

presenter/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
alias(libs.plugins.android.library)
33
alias(libs.plugins.jetbrains.kotlin.android)
4+
alias(libs.plugins.kotlin.compose)
45
}
56

67
android {

0 commit comments

Comments
 (0)