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)