From 49c3334509bcebdaf1a609e7308e7a5b780678eb Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 6 Jun 2023 15:49:52 -0400 Subject: [PATCH] activates compose reports --- build.gradle | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index e8f7522c3..bdfed50e2 100644 --- a/build.gradle +++ b/build.gradle @@ -26,4 +26,25 @@ task installGitHook(type: Copy) { into { new File(rootProject.rootDir, '.git/hooks') } fileMode 0777 } -tasks.getByPath(':app:preBuild').dependsOn installGitHook \ No newline at end of file +tasks.getByPath(':app:preBuild').dependsOn installGitHook + +subprojects { + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { + kotlinOptions { + if (project.findProperty("composeCompilerReports") == "true") { + freeCompilerArgs += [ + "-P", + "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + + project.buildDir.absolutePath + "/compose_compiler" + ] + } + if (project.findProperty("composeCompilerMetrics") == "true") { + freeCompilerArgs += [ + "-P", + "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + + project.buildDir.absolutePath + "/compose_compiler" + ] + } + } + } +} \ No newline at end of file