build(gradle): jvmTarget를 compilerOptions+jvmToolchain으로 마이그레이션
Kotlin 2.x에서 deprecated된 `kotlinOptions.jvmTarget` 사용을 제거하고
최신 DSL(`kotlin { jvmToolchain(17); compilerOptions { jvmTarget = JVM_17 } }`)로 전환했습니다.
왜: Kotlin Gradle Plugin 2.x에서 `kotlinOptions.jvmTarget`가 deprecated되어 빌드 경고가 발생했습니다.
무엇: `app/build.gradle`의 `kotlinOptions { jvmTarget = ... }` 제거 후, 최상위 `kotlin` 블록을 추가하여
- `jvmToolchain(17)` 설정
- `compilerOptions { jvmTarget.set(JVM_17) }` 적용
영향: 컴파일 타깃과 JDK 툴체인을 명시적으로 17로 고정하여 빌드 일관성을 확보하고 경고를 제거합니다.
This commit is contained in:
@@ -13,7 +13,7 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace 'kr.co.vividnext.sodalive'
|
||||
compileSdk 34
|
||||
compileSdk = 34
|
||||
|
||||
viewBinding {
|
||||
enabled true
|
||||
@@ -93,9 +93,6 @@ android {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_17.toString()
|
||||
}
|
||||
lint {
|
||||
checkDependencies true
|
||||
checkReleaseBuilds false
|
||||
@@ -221,3 +218,15 @@ ksp {
|
||||
arg("room.incremental", "true")
|
||||
arg("room.expandProjection", "true")
|
||||
}
|
||||
|
||||
|
||||
// Kotlin compiler and toolchain configuration (migrated from deprecated kotlinOptions.jvmTarget)
|
||||
kotlin {
|
||||
// Ensures Kotlin compiles with Java 17 toolchain
|
||||
jvmToolchain(17)
|
||||
|
||||
// New DSL replacing kotlinOptions.jvmTarget
|
||||
compilerOptions {
|
||||
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user