chore: kotlin 2.0.0

This commit is contained in:
lisonge 2024-05-22 20:10:44 +08:00
parent 3f7971b438
commit 10d174dde9
5 changed files with 26 additions and 17 deletions

1
.gitignore vendored
View File

@ -21,3 +21,4 @@ local.properties
*.keystore *.keystore
/_assets /_assets
/.kotlin

View File

@ -39,6 +39,7 @@ plugins {
alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize) alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.kotlin.serialization) alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.google.ksp) alias(libs.plugins.google.ksp)
alias(libs.plugins.google.hilt) alias(libs.plugins.google.hilt)
alias(libs.plugins.rikka.refine) alias(libs.plugins.rikka.refine)
@ -132,9 +133,6 @@ android {
compose = true compose = true
aidl = true aidl = true
} }
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
packagingOptions.resources.excludes += setOf( packagingOptions.resources.excludes += setOf(
// https://github.com/Kotlin/kotlinx.coroutines/issues/2023 // https://github.com/Kotlin/kotlinx.coroutines/issues/2023
"META-INF/**", "**/attach_hotspot_windows.dll", "META-INF/**", "**/attach_hotspot_windows.dll",
@ -146,21 +144,29 @@ android {
"**/custom.config.conf", "**/custom.config.conf",
"**/custom.config.yaml", "**/custom.config.yaml",
) )
configurations.configureEach {
// https://github.com/Kotlin/kotlinx.coroutines/issues/2023
exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-debug")
}
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
arg("room.incremental", "true")
arg("room.generateKotlin", "true")
}
sourceSets.configureEach { sourceSets.configureEach {
kotlin.srcDir("${layout.buildDirectory.asFile.get()}/generated/ksp/$name/kotlin/") kotlin.srcDir("${layout.buildDirectory.asFile.get()}/generated/ksp/$name/kotlin/")
} }
} }
configurations.configureEach {
// https://github.com/Kotlin/kotlinx.coroutines/issues/2023
exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-debug")
}
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
arg("room.incremental", "true")
arg("room.generateKotlin", "true")
}
composeCompiler {
// https://developer.android.com/develop/ui/compose/performance/stability/strongskipping?hl=zh-cn
enableStrongSkippingMode = true
reportsDestination = layout.buildDirectory.dir("compose_compiler")
stabilityConfigurationFile = rootProject.layout.projectDirectory.file("stability_config.conf")
}
dependencies { dependencies {
implementation(project(mapOf("path" to ":selector"))) implementation(project(mapOf("path" to ":selector")))

View File

@ -25,6 +25,7 @@ plugins {
alias(libs.plugins.kotlin.multiplatform) apply false alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.rikka.refine) apply false alias(libs.plugins.rikka.refine) apply false
} }

View File

@ -1,13 +1,12 @@
[versions] [versions]
kotlin = "1.9.23" kotlin = "2.0.0"
ksp = "1.9.23-1.0.19" ksp = "2.0.0-1.0.21"
compileSdk = "34" compileSdk = "34"
targetSdk = "34" targetSdk = "34"
buildToolsVersion = "34.0.0" buildToolsVersion = "34.0.0"
minSdk = "26" minSdk = "26"
android = "8.4.0" android = "8.4.1"
compose = "1.6.7" compose = "1.6.7"
composeCompiler = "1.5.13"
rikka = "4.4.0" rikka = "4.4.0"
room = "2.6.1" room = "2.6.1"
paging = "3.3.0" paging = "3.3.0"
@ -80,6 +79,7 @@ kotlin_serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi
kotlin_parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } kotlin_parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
kotlin_multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } kotlin_multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin_android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin_android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin_compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
rikka_refine = { id = "dev.rikka.tools.refine", version.ref = "rikka" } rikka_refine = { id = "dev.rikka.tools.refine", version.ref = "rikka" }
google_ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } google_ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
google_hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } google_hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }

1
stability_config.conf Normal file
View File

@ -0,0 +1 @@
li.songe.gkd.*