Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 1.04 KB

README.md

File metadata and controls

34 lines (27 loc) · 1.04 KB

Example how to generate compose compiler reports to ensure stability of all written composables

(Project based on one of the talks hosted by GDSC Warsaw I had the pleasure to attend :))




for future reference:

Version for Kotlin DSL:

subprojects {
    tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
        compilerOptions {
            if (project.findProperty("enableComposeCompilerReports") == "true") {
                freeCompilerArgs.addAll(
                    listOf(
                        "-P",
                        "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${project.buildDir.absolutePath}/compose_metrics"
                    )
                )
                freeCompilerArgs.addAll(
                    listOf(
                        "-P",
                        "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=${project.buildDir.absolutePath}/compose_metrics"
                    )
                )
            }
        }
    }
}