Dawid-Witkowski/ComposeCompilerRaport

★ 0Forks 0KotlinGitHub ↗Compare

README

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"
                    )
                )
            }
        }
    }
}

Contributors

Dawid-Witkowski

Issues