[Build] Add size config JSON files and supports.
Previously, generate_commit_size_analysis.py takes: * --apk-name for SuperSize "main file" input (.apk or .minimal.apks). * --mapping-name for "mapping file" input. This worked fine for Monochrome. However, for Trichrome, the SuperSize "main file" is now an .ssargs file that specifies 3 "container files", which for Monochrome, coincided with the "main file". To centralize the specification of all these files from BUILD files, we define "size config JSON" file to specify the following: * Mapping files (as a list). * Arguments to be passed to resource_sizes.py (which already supports Trichrome). * Supersize main file, which can be {.apk, .minimal.apks, .ssargs}. * Version numeric string (for late ruse). This CL adds size config JSON support. Details: * Add GN template "android_resource_size_config" to specify size config JSON files. Files are generated during "gn gen", and written to config/ under Chromium output dir. * Add GN targets to generate size config JSON files for Monochrome and Trichrome * resource_size_config_monochrome_public_minimal_apks -> config/MonochromePublic_size_config.json * resource_size_config_trichrome -> config/Trichrome_size_config.json * In generate_commit_size_analysis.py: * Add --size-config-json to specify size config JSON path. * If specified, the file is copied to the staging dir. * If the "main file" is .ssargs, then it's also copied to the staging dir. * Add Trichrome support to call resource_sizes.py * In trybot_commit_size_checker.py: * Add --size-config-json-name to specify size config JSON *filename*, which will be searched in {before, after} dirs. * If specified, "mapping files" are directly extracted from the size config JSON files for "ForTest" symbol extraction. * This will replace the --apk-name argument. With this CL, size config JSON files and supports are available but unused. Usages will be added in follow-up work. Bug: 1040645 Change-Id: Ie3328ac413af3a15cd1cbb0957881da7d2d1f839 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2518126 Commit-Queue: Samuel Huang <huangs@chromium.org> Reviewed-by:Mohamed Heikal <mheikal@chromium.org> Reviewed-by:
Andrew Grieve <agrieve@chromium.org> Cr-Commit-Position: refs/heads/master@{#824562}
Showing
Please register or sign in to comment