CLI Utility¶
Pre-requisite¶
This CLI utility just takes care of generating beautified report from generated raw report by Compose compiler. Thus, before using CLI, you'll need to generate compose compiler metrics and reports manually.
How to generate Compose Compiler metric and report?¶
Make sure to generate Compose compiler metrics and reports as mentioned here or this good read article by Chris Banes. These files are then needed to this CLI utility to feed the data.
To generate the report, provide details related to app, metric and report files and output directory.
Using CLI¶
CLI utility is available in the two forms:
- JAR Distribution
- NPM package
1. Install the distribution¶
Navigate to the releases and download the latest JAR artifact.
2. Know usage¶
Run the command to know the usage of CLI
▶️Output
Usage: Compose Compiler Report to HTML Generator ~ v1.4.1 options_list
Options:
--applicationName, -app -> Application name (To be displayed in the report) (always required) { String }
--inputDirectory, -i -> Input directory where composable report and metrics are available { String }
--overallStatsFile, -overallStatsReport -> Overall Statistics Metrics JSON files (separated by commas) { String }
--detailedStatsFile, -detailedStatsMetrics -> Detailed Statistics Metrics CSV files (separated by commas) { String }
--composableMetricsFile, -composableMetrics -> Composable Metrics TXT files (separated by commas) { String }
--classMetricsFile, -classMetrics -> Class Metrics TXT files (separated by commas) { String }
--outputDirectory, -o -> Output directory name { String }
--includeStableComposables [true] -> Whether to include stable Composable functions in the report
--includeStableClasses [true] -> Whether to include stable classes in the report
--includeClasses [true] -> Whether to include all the classes in the report
--showOnlyUnstableComposables [false] -> Whether to ONLY include unstable composables in the report
--help, -h -> Usage info
3. Generate report¶
HTML Report can be generated with the following combinations.
3.1 When all metric and report files are available in the same directory¶
Assuming report and metrics generated by Compose Compiler are available in one directory then you can specify path to that directory only and utility will automatically pick files.
Info
In the above command, path provided to -i
parameter assumes all metrics and report are present and generates and saves report in the path provided to -o
parameter.
3.2 Provide path to individual report and metric files¶
You can provide each metric/report file individually using separate parameters.
Info
Multiple metric/report files can be provided as a CLI parameter by providing path separated by comma (,
).