diff --git a/.gitignore b/.gitignore index 6d8ce4b..8f36f31 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ local.properties *.keystore /_assets +/.kotlin diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e8ac74c..47ea3e9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -39,6 +39,7 @@ plugins { alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.parcelize) alias(libs.plugins.kotlin.serialization) + alias(libs.plugins.kotlin.compose) alias(libs.plugins.google.ksp) alias(libs.plugins.google.hilt) alias(libs.plugins.rikka.refine) @@ -132,9 +133,6 @@ android { compose = true aidl = true } - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() - } packagingOptions.resources.excludes += setOf( // https://github.com/Kotlin/kotlinx.coroutines/issues/2023 "META-INF/**", "**/attach_hotspot_windows.dll", @@ -146,21 +144,29 @@ android { "**/custom.config.conf", "**/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 { 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 { implementation(project(mapOf("path" to ":selector"))) diff --git a/build.gradle.kts b/build.gradle.kts index 73871f2..2d66063 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,6 +25,7 @@ plugins { alias(libs.plugins.kotlin.multiplatform) apply false alias(libs.plugins.kotlin.android) apply false + alias(libs.plugins.kotlin.compose) apply false alias(libs.plugins.rikka.refine) apply false } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8b50de2..9954701 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,13 +1,12 @@ [versions] -kotlin = "1.9.23" -ksp = "1.9.23-1.0.19" +kotlin = "2.0.0" +ksp = "2.0.0-1.0.21" compileSdk = "34" targetSdk = "34" buildToolsVersion = "34.0.0" minSdk = "26" -android = "8.4.0" +android = "8.4.1" compose = "1.6.7" -composeCompiler = "1.5.13" rikka = "4.4.0" room = "2.6.1" 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_multiplatform = { id = "org.jetbrains.kotlin.multiplatform", 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" } google_ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } google_hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } diff --git a/stability_config.conf b/stability_config.conf new file mode 100644 index 0000000..b534575 --- /dev/null +++ b/stability_config.conf @@ -0,0 +1 @@ +li.songe.gkd.*