Hello! Is there a way to enable compose compiler m...
# compose-desktop
m
Hello! Is there a way to enable compose compiler metrics in compose-desktop?
s
Add this to build.gradle:
Copy code
allprojects {
    tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinCompile::class.java).configureEach {
        kotlinOptions {
            // Trigger this with:
            // ./gradlew build -PenableMultiModuleComposeReports=true --rerun-tasks
            if (project.findProperty("enableMultiModuleComposeReports") == "true") {

                val path = layout.buildDirectory.dir("compose_metrics").get().asFile.absolutePath

                freeCompilerArgs += listOf(
                    "-P",
                    "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=$path",
                    "-P",
                    "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=$path",
                )
            }
        }
    }
}
👀 1