A plugin to generates HTML report from raw Compose metrics.
- Go to your
toml
file add below
[versions]
plugin_compose_metric_reporter = "0.0.3"
[plugins]
composeMetricReporter = { id = "io.gitlab.hamurcuabi.compose.metric.reporter.plugin", version.ref = "plugin_compose_metric_reporter" }
- Go to module that you want to create compose report
plugins {
alias(libs.plugins.composeMetricReporter)
}
android {
composeCompiler {
reportsDestination = project.layout.buildDirectory.dir(COMPOSE_METRICS_PATH)
metricsDestination = project.layout.buildDirectory.dir(COMPOSE_METRICS_PATH)
}
}
composeReporter {
toolbarTitle = "Compose Toolbar title"
outputPath = "compose-report"
excludeSuffixForFunctions = listOf("Preview")
excludeSuffixForClasses = listOf("Activity")
hideComposableWithNoParams = true
}
- Run
./gradlew tasks
, You will see some tasks with each variant like below
Compose Metric Reporter tasks
-----------------------------
presentation_developmentDebugMetricReporter - Generate Compose Compiler Metrics and Report for 'developmentDebug' variant in Android project
presentation_developmentReleaseMetricReporter - Generate Compose Compiler Metrics and Report for 'developmentRelease' variant in Android project
presentation_pilotDebugMetricReporter - Generate Compose Compiler Metrics and Report for 'pilotDebug' variant in Android project
....
Chose one of them and run it.
./gradlew presentation_developmentDebugMetricReporter
You can see metrics and reports generated under build folder ends with <project-name>-compose-report
.
Open index.html
file with your browser