Skip to content

Commit 5be13a0

Browse files
committed
Enable strong skipping
1 parent b993536 commit 5be13a0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/AndroidCompose.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ internal fun Project.configureAndroidCompose(
5757
kotlinOptions {
5858
freeCompilerArgs += buildComposeMetricsParameters()
5959
freeCompilerArgs += stabilityConfiguration()
60+
freeCompilerArgs += strongSkippingConfiguration()
6061
}
6162
}
6263
}
@@ -84,10 +85,16 @@ private fun Project.buildComposeMetricsParameters(): List<String> {
8485
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + reportsFolder.absolutePath
8586
)
8687
}
88+
8789
return metricParameters.toList()
8890
}
8991

9092
private fun Project.stabilityConfiguration() = listOf(
9193
"-P",
9294
"plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=${project.rootDir.absolutePath}/compose_compiler_config.conf",
9395
)
96+
97+
private fun Project.strongSkippingConfiguration() = listOf(
98+
"-P",
99+
"plugin:androidx.compose.compiler.plugins.kotlin:experimentalStrongSkipping=true",
100+
)

compose_compiler_config.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@
22
// It allows us to define classes that our not part of our codebase without wrapping them in a stable class.
33
// For more information, check https://developer.android.com/jetpack/compose/performance/stability/fix#configuration-file
44

5+
// We always use immutable classes for our data model, to avoid running the Compose compiler
6+
// in the module we declare it to be stable here.
7+
com.google.samples.apps.nowinandroid.core.model.data.*
8+
9+
// Java standard library classes
510
java.time.ZoneId
611
java.time.ZoneOffset

0 commit comments

Comments
 (0)