feat: enable Compose strong skipping mode

This commit is contained in:
Harsh Shandilya 2024-04-09 00:54:53 +05:30
parent a410267f99
commit 659eaf9789

View file

@ -1,5 +1,5 @@
/* /*
* Copyright © 2022-2023 Harsh Shandilya. * Copyright © 2022-2024 Harsh Shandilya.
* Use of this source code is governed by an MIT-style * Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at * license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT. * https://opensource.org/licenses/MIT.
@ -30,10 +30,14 @@ class KotlinAndroidPlugin : Plugin<Project> {
val composeCompilerVersion = libs.versions.composeCompiler.get() val composeCompilerVersion = libs.versions.composeCompiler.get()
val kotlinVersion = libs.versions.kotlin.get() val kotlinVersion = libs.versions.kotlin.get()
val matches = COMPOSE_COMPILER_VERSION_REGEX.find(composeCompilerVersion) val matches = COMPOSE_COMPILER_VERSION_REGEX.find(composeCompilerVersion)
if (matches != null) { project.tasks.withType<KotlinCompile>().configureEach {
val (compilerKotlinVersion) = matches.destructured compilerOptions.freeCompilerArgs.addAll(
if (compilerKotlinVersion != kotlinVersion) { "-P",
project.tasks.withType<KotlinCompile>().configureEach { "plugin:androidx.compose.compiler.plugins.kotlin:experimentalStrongSkipping=true",
)
if (matches != null) {
val (compilerKotlinVersion) = matches.destructured
if (compilerKotlinVersion != kotlinVersion) {
compilerOptions.freeCompilerArgs.addAll( compilerOptions.freeCompilerArgs.addAll(
"-P", "-P",
"plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=$kotlinVersion", "plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=$kotlinVersion",