build: Add param to generate Compose compiler metrics (#8330)

./gradlew assembledevPreview -Ptachiyomi.enableComposeCompilerMetrics=true

(cherry picked from commit 9fbd3fe33f57412838291be54f477e22254dcbb7)
This commit is contained in:
Ivan Iskandar 2022-10-29 20:37:48 +07:00 committed by Jobobby04
parent d8b27a4f43
commit 2fe7fe1a3f

View File

@ -339,6 +339,19 @@ tasks {
"-opt-in=kotlinx.coroutines.InternalCoroutinesApi",
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
)
if (project.findProperty("tachiyomi.enableComposeCompilerMetrics") == "true") {
kotlinOptions.freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
project.buildDir.absolutePath + "/compose_metrics"
)
kotlinOptions.freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
project.buildDir.absolutePath + "/compose_metrics"
)
}
}
preBuild {