Skip to content

Commit

Permalink
[fix]: kotlin version update
Browse files Browse the repository at this point in the history
  • Loading branch information
kez-lab committed Jan 2, 2025
1 parent b8423f9 commit 63b96d8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,6 @@ fabric.properties
!/gradle/wrapper/gradle-wrapper.jar

# End of https://www.toptal.com/developers/gitignore/api/android,androidstudio,kotlin
# kotlin 2.0.0
.DS_Store
.kotlin/
1 change: 1 addition & 0 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies {
compileOnly(libs.agp)
compileOnly(libs.kotlin.gradleplugin)
compileOnly(libs.ksp.gradlePlugin)
compileOnly(libs.compose.compiler.extension)
}

gradlePlugin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import org.gradle.api.JavaVersion
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.api.plugins.ExtensionAware
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension

class AndroidKotlinPlugin : Plugin<Project> {
override fun apply(target: Project) = with(target) {
Expand All @@ -32,8 +31,10 @@ class AndroidKotlinPlugin : Plugin<Project> {
targetCompatibility = JavaVersion.VERSION_17
}

(this as ExtensionAware).configure<KotlinJvmOptions> {
jvmTarget = "17"
extensions.getByType<KotlinAndroidProjectExtension>().apply {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
package com.hmh.hamyeonham.plugin

import com.android.build.gradle.BaseExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag

class ComposePlugin : Plugin<Project> {
override fun apply(target: Project) = with(target) {
plugins.apply("org.jetbrains.kotlin.plugin.compose")

val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
extensions.getByType<BaseExtension>().apply {
buildFeatures.apply {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.findVersion("compose.compiler").get().requiredVersion
}
extensions.getByType<ComposeCompilerGradlePluginExtension>().apply {
featureFlags.set(setOf(ComposeFeatureFlag.StrongSkipping))
includeSourceInformation.set(true)
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ plugins {
alias(libs.plugins.google.services) apply false
alias(libs.plugins.app.distribution) apply false
alias(libs.plugins.crashlytics) apply false
alias(libs.plugins.compose.compiler) apply false
}

tasks.register("clean", Delete::class) {
Expand Down
15 changes: 8 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ appVersion = "1.0.3"
versionCode = "1000300"

# kotlin
kotlin = "1.9.25"
kotlinx-serialization-json = "1.6.3"
kotlin = "2.0.21"
kotlinx-serialization-json = "1.7.3"
kotlinx-serialization-converter = "1.0.0"
kotlinx-coroutines = "1.8.1"
kotlinx-coroutines = "1.9.0"
kotlinx-datetime = "0.6.1"
ksp = "1.9.24-1.0.20"
ksp = "2.0.21-1.0.27"

# android
corektx = "1.13.1"
Expand All @@ -21,7 +21,6 @@ lifecycle = "2.8.7"
navigation = "2.7.7"
startup = "1.2.0"
security = "1.1.0-alpha06"
compose-compiler = "1.5.14"
compose-bom = "2024.12.01"
desugarJdk = "2.0.4"
dagger-hilt = "2.54"
Expand Down Expand Up @@ -62,7 +61,6 @@ runner = "1.5.2"

# gradle
agp = "8.7.3"
kspplugin = "1.9.24-1.0.20"

# third party
soloader = "0.11.0"
Expand Down Expand Up @@ -134,6 +132,8 @@ lifecycle-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-co
navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation" }
splash-screen = { module = "androidx.core:core-splashscreen", version.ref = "splash-screen" }

compose-compiler-extension = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "kotlin" }

# dagger-hilt
hilt = { module = "com.google.dagger:hilt-android", version.ref = "dagger-hilt" }
hilt-compiler = { module = "com.google.dagger:hilt-compiler", version.ref = "dagger-hilt" }
Expand Down Expand Up @@ -228,13 +228,14 @@ dagger-hilt = { id = "com.google.dagger.hilt.android", version.ref = "dagger-hil
google-services = { id = "com.google.gms.google-services", version.ref = "google-services" }
crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "crashlytics" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
ksp = { id = "com.google.devtools.ksp", version.ref = "kspplugin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
secret = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secret-gradle-plugin" }
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
sentry = { id = "io.sentry.android.gradle", version.ref = "sentry" }
junit5 = { id = "de.mannodermaus.android-junit5", version.ref = "junit5-plugin" }
app-distribution = { id = "com.google.firebase.appdistribution", version.ref = "app-distribution" }
oss = { id = "com.google.android.gms.oss-licenses-plugin", version.ref = "oss-plugin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

[bundles]
navigation = ["navigation-fragment", "navigation-ui"]
Expand Down

0 comments on commit 63b96d8

Please sign in to comment.