From d31d7e022199819e8c35e26d265d46fc6ef43c30 Mon Sep 17 00:00:00 2001 From: Goooler Date: Wed, 4 Sep 2024 11:26:03 +0800 Subject: [PATCH] chore: migrate Compose Compiler flags https://developer.android.com/develop/ui/compose/performance/stability/diagnose#setup --- 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 b0f424199..6adb422de 100644 --- a/maps-compose/build.gradle.kts +++ b/maps-compose/build.gradle.kts @@ -25,25 +25,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") } }