Skip to content

Commit

Permalink
升级 Kotlin 到 2.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
keepactive committed Nov 8, 2024
1 parent c6be9f0 commit b71a663
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 23 deletions.
16 changes: 8 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
apply plugin: 'com.android.application'
apply plugin: 'com.xiaojinzi.kcomponent.plugin'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.devtools.ksp'
plugins {
id 'com.android.application'
alias(libs.plugins.compose.compiler)
id "com.xiaojinzi.kcomponent.plugin"
id "kotlin-android"
id "com.google.devtools.ksp"
}

apply from: "../common_lib.gradle"

Expand Down Expand Up @@ -43,10 +46,7 @@ android {
buildFeatures {
// Enables Jetpack Compose for this module
compose true
}
composeOptions {
kotlinCompilerExtensionVersion libs.versions.compose.kotlin.compiler.extension.get()
kotlinCompilerVersion libs.versions.kotlin.asProvider().get()
buildConfig true
}

buildTypes {
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ buildscript {
}

plugins {
id "com.google.devtools.ksp" version libs.versions.kotlin.ksp apply false
alias(libs.plugins.kotlin.ksp) apply false
alias(libs.plugins.compose.compiler) apply false
}

tasks.register('clean', Delete) {
Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# close ksp incremental
ksp.incremental=false
android.defaults.buildfeatures.buildconfig=true
ksp.incremental=false
14 changes: 9 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
compileSdkVersion = "35"
gradleVersion = "8.2.2"
gradleVersion = "8.7.2"
minSdkVersion = "21"
targetSdkVersion = "35"
component = "8c968cf766"
Expand All @@ -9,10 +9,10 @@ compose_kotlin_compiler_extension = "1.5.15"
compose_material_version = "1.7.5"
compose_material3_version = "1.3.1"
accompanist_version = "0.36.0"
kotlin = "1.9.25"
# kotlin = "2.0.20"
kotlin_ksp = "1.9.25-1.0.20"
# kotlin_ksp = "2.0.20-1.0.25"
# kotlin = "1.9.25"
kotlin = "2.0.21"
# kotlin_ksp = "1.9.25-1.0.20"
kotlin_ksp = "2.0.21-1.0.26"
kotlin_coroutines = "1.9.0"

[libraries]
Expand Down Expand Up @@ -65,3 +65,7 @@ component_compiler = { group = "com.github.xiaojinzi123.KComponent", name = "kco
component_impl = { group = "com.github.xiaojinzi123.KComponent", name = "kcomponent", version.ref = "component" }
component_impl_rx = { group = "com.github.xiaojinzi123.KComponent", name = "kcomponent-rx", version.ref = "component" }
component_plugin = { group = "com.github.xiaojinzi123.KComponent", name = "kcomponent-plugin", version.ref = "component" }

[plugins]
kotlin-ksp = {id = "com.google.devtools.ksp", version.ref = "kotlin_ksp"}
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
13 changes: 6 additions & 7 deletions lib-compose/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
plugins {
id "com.android.library"
alias(libs.plugins.compose.compiler)
id "kotlin-android"
id "maven-publish"
}

apply from: "../common_lib.gradle"

Expand All @@ -12,10 +15,6 @@ android {
// Enables Jetpack Compose for this module
compose true
}
composeOptions {
kotlinCompilerExtensionVersion libs.versions.compose.kotlin.compiler.extension.get()
kotlinCompilerVersion libs.versions.kotlin.asProvider().get()
}
namespace 'com.xiaojinzi.support.compose'
}

Expand Down

0 comments on commit b71a663

Please sign in to comment.