From e660791549ebb1ee46d755f8433af29e3af91e3d Mon Sep 17 00:00:00 2001 From: Zongle Wang Date: Wed, 16 Oct 2024 04:57:09 -0400 Subject: [PATCH] chore: migrate Compose Compiler flags and enable strong skipping mode (#625) * chore: migrate Compose Compiler flags https://developer.android.com/develop/ui/compose/performance/stability/diagnose#setup * chore: update Kotlin 2.0.20 and enable strong skipping mode Strong skipping mode is the default from Kotlin 2.0.20 https://github.com/JetBrains/kotlin/releases/tag/v2.0.20 --- maps-compose/build.gradle.kts | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/maps-compose/build.gradle.kts b/maps-compose/build.gradle.kts index 0d4e9c070..3b88cf16c 100644 --- a/maps-compose/build.gradle.kts +++ b/maps-compose/build.gradle.kts @@ -28,25 +28,21 @@ android { kotlinOptions { jvmTarget = "1.8" - val stabilityConfigurationFile = layout.projectDirectory.file("compose_compiler_stability_config.conf").asFile freeCompilerArgs += listOf( "-Xexplicit-api=strict", "-Xopt-in=kotlin.RequiresOptIn", - "-P", - "plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=${stabilityConfigurationFile.absolutePath}" ) - if (findProperty("composeCompilerReports") == "true") { - freeCompilerArgs += listOf( - "-P", - "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${layout.buildDirectory.dir("compose_compiler").get()}", - ) - } - if (findProperty("composeCompilerMetrics") == "true") { - freeCompilerArgs += listOf( - "-P", - "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=${layout.buildDirectory.dir("compose_compiler").get()}", - ) - } + } +} + +composeCompiler { + stabilityConfigurationFile = + layout.projectDirectory.file("compose_compiler_stability_config.conf") + if (findProperty("composeCompilerReports") == "true") { + reportsDestination = layout.buildDirectory.dir("compose_compiler") + } + if (findProperty("composeCompilerMetrics") == "true") { + metricsDestination = layout.buildDirectory.dir("compose_compiler") } }