Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT/#346] Kotlin 2.0 마이그레이션 #347

Merged
merged 7 commits into from
Mar 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ gen-external-apklibs
# BlueJ files
*.ctxt

# Kotlin files
.kotlin/

# Mobile Tools for Java (J2ME)
.mtj.tmp/

Expand Down
10 changes: 5 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import com.terning.build_logic.extension.setNamespace
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.util.Properties

plugins {
Expand Down Expand Up @@ -64,15 +65,14 @@ android {
proguardFiles("baseline-profiles-rules.pro")
}
}
kotlinOptions {
jvmTarget = libs.versions.jvmTarget.get()
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}
buildFeatures {
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.kotlinCompilerExtensionVersion.get()
}
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
dependencies {
implementation(libs.android.gradlePlugin)
implementation(libs.kotlin.gradlePlugin)
compileOnly(libs.compose.compiler.gradle.plugin)
compileOnly(libs.compose.compiler.extension)
}

tasks.named("compileTestKotlin") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
package com.terning.build_logic.convention

import com.android.build.gradle.BaseExtension
import com.terning.build_logic.extension.libs
import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension

internal fun Project.configureComposeAndroid() {

val libs = extensions.libs

extensions.getByType<BaseExtension>().apply {
composeOptions {
kotlinCompilerExtensionVersion =
libs.findVersion("kotlinCompilerExtensionVersion").get().requiredVersion
}
with(plugins) {
apply("org.jetbrains.kotlin.plugin.compose")
}

extensions.getByType<BaseExtension>().apply {
buildFeatures.compose = true
}
val libs = extensions.libs

dependencies {
add("implementation", libs.findLibrary("androidx.compose.material3").get())
Expand All @@ -32,4 +24,9 @@ internal fun Project.configureComposeAndroid() {
add("implementation", libs.findLibrary("androidx.lifecycle.runtimeCompose").get())
add("implementation", libs.findLibrary("androidx.lifecycle.viewModelCompose").get())
}

extensions.getByType<ComposeCompilerGradlePluginExtension>().apply {
enableStrongSkippingMode.set(true)
includeSourceInformation.set(true)
}
}
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ plugins {
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.dokka) apply false
alias(libs.plugins.baselineprofile) apply false
alias(libs.plugins.compose.compiler) apply false
}

buildscript {
Expand Down
9 changes: 4 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ minSdk = "28"
targetSdk = "35"
versionName = "1.2.2"
versionCode = "102020"
kotlinCompilerExtensionVersion = "1.5.2"
jvmTarget = "1.8"

## Android gradle plugin
Expand All @@ -19,7 +18,7 @@ androidxActivity = "1.9.0"
androidxDatastore = "1.1.1"

## Kotlin Symbol Processing
ksp = "1.9.0-1.0.12"
ksp = "2.0.0-1.0.22"

## Compose
androidxComposeBom = "2024.04.01"
Expand All @@ -41,7 +40,7 @@ workManagerVersion = "2.8.1"
ossVersion = "17.0.0"

## Kotlin
kotlin = "1.9.0"
kotlin = "2.0.0"
kotlinxImmutable = "0.3.7"
kotlinxSerializationJsonVersion = "1.5.1"
serialization = "1.6.3"
Expand Down Expand Up @@ -128,7 +127,6 @@ androidx-compose-ui-testManifest = { group = "androidx.compose.ui", name = "ui-t
androidx-compose-navigation = { group = "androidx.navigation", name = "navigation-compose", version.ref = "composeNavigation" }
androidx-compose-navigation-test = { group = "androidx.navigation", name = "navigation-testing", version.ref = "composeNavigation" }
androidx-compose-saveable = { group = "androidx.compose.runtime", name = "runtime-saveable", version.ref = "composeSavable" }
compose-compiler-gradle-plugin = { group = "androidx.compose.compiler", name = "compiler", version.ref = "kotlinCompilerExtensionVersion" }

androidx-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
Expand Down Expand Up @@ -173,6 +171,7 @@ coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-
kotlin = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" }
kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-collections-immutable = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version.ref = "kotlinx-collections-immutable" }
compose-compiler-extension = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "kotlin" }

coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coilCompose" }
coil-network-okhttp = { module = "io.coil-kt.coil3:coil-network-okhttp", version.ref = "coilCompose" }
Expand Down Expand Up @@ -217,8 +216,8 @@ android-test = { id = "com.android.test", version.ref = "androidGradlePlugin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlinParcelize" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version = "kotlinCompilerExtensionVersion" }
baselineprofile = { id = "androidx.baselineprofile", version.ref = "baselineprofile" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

terning-application = { id = "terning.android.application", version = "unspecified" }
terning-compose = { id = "terning.android.compose", version = "unspecified" }
Expand Down