From 0d668ac3aaff92415e5b683e265e473330850b9b Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 12 Dec 2022 02:37:39 +0530 Subject: [PATCH] chore: enable Compose Compiler metrics --- android/build.gradle.kts | 19 +++++++++++++++++++ common/build.gradle.kts | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/android/build.gradle.kts b/android/build.gradle.kts index 7d4ac612..c92162cc 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -6,6 +6,9 @@ */ @file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage") +import org.gradle.kotlin.dsl.withType +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + plugins { id("dev.msfjarvis.claw.android-application") id("dev.msfjarvis.claw.rename-artifacts") @@ -23,6 +26,22 @@ whetstone { } } +tasks.withType().configureEach { + kotlinOptions { + freeCompilerArgs += + listOf( + "-P", + "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + + rootProject.buildDir.absolutePath + + "/compose_metrics/", + "-P", + "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + + rootProject.buildDir.absolutePath + + "/compose_metrics/", + ) + } +} + android { namespace = "dev.msfjarvis.claw.android" defaultConfig { applicationId = "dev.msfjarvis.claw.android" } diff --git a/common/build.gradle.kts b/common/build.gradle.kts index a0edae91..a22a97f4 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -6,6 +6,9 @@ */ @file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage") +import org.gradle.kotlin.dsl.withType +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + plugins { id("dev.msfjarvis.claw.kotlin-android") id("dev.msfjarvis.claw.android-library") @@ -17,6 +20,22 @@ anvil { generateDaggerFactories.set(true) } androidComponents { beforeVariants { it.enableUnitTest = false } } +tasks.withType().configureEach { + kotlinOptions { + freeCompilerArgs += + listOf( + "-P", + "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + + rootProject.buildDir.absolutePath + + "/compose_metrics/", + "-P", + "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + + rootProject.buildDir.absolutePath + + "/compose_metrics/", + ) + } +} + dependencies { implementation(platform(libs.androidx.compose.bom)) api(libs.napier)