chore: enable Compose Compiler metrics

This commit is contained in:
Harsh Shandilya 2022-12-12 02:37:39 +05:30
parent b1a32496ba
commit 0d668ac3aa
No known key found for this signature in database
2 changed files with 38 additions and 0 deletions

View file

@ -6,6 +6,9 @@
*/ */
@file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage") @file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage")
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
id("dev.msfjarvis.claw.android-application") id("dev.msfjarvis.claw.android-application")
id("dev.msfjarvis.claw.rename-artifacts") id("dev.msfjarvis.claw.rename-artifacts")
@ -23,6 +26,22 @@ whetstone {
} }
} }
tasks.withType<KotlinCompile>().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 { android {
namespace = "dev.msfjarvis.claw.android" namespace = "dev.msfjarvis.claw.android"
defaultConfig { applicationId = "dev.msfjarvis.claw.android" } defaultConfig { applicationId = "dev.msfjarvis.claw.android" }

View file

@ -6,6 +6,9 @@
*/ */
@file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage") @file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage")
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
id("dev.msfjarvis.claw.kotlin-android") id("dev.msfjarvis.claw.kotlin-android")
id("dev.msfjarvis.claw.android-library") id("dev.msfjarvis.claw.android-library")
@ -17,6 +20,22 @@ anvil { generateDaggerFactories.set(true) }
androidComponents { beforeVariants { it.enableUnitTest = false } } androidComponents { beforeVariants { it.enableUnitTest = false } }
tasks.withType<KotlinCompile>().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 { dependencies {
implementation(platform(libs.androidx.compose.bom)) implementation(platform(libs.androidx.compose.bom))
api(libs.napier) api(libs.napier)