Skip to content

Commit

Permalink
chore: migrate Compose Compiler flags and enable strong skipping mode (
Browse files Browse the repository at this point in the history
…#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
  • Loading branch information
Goooler authored Oct 16, 2024
1 parent e37c8bb commit e660791
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions maps-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

Expand Down

0 comments on commit e660791

Please sign in to comment.