tools: Add CSV support to idf_size.py

This adds CSV support to idf_size.py and idf.py size actions and using the --format argument which accepts 'text', 'json' or 'csv' as input.

idf_size.py --json argument is deprecated but left to avoid a breaking change.

For idf.py size actions OUTPUT_JSON environment variable set at configuration time is overriden at target build time if --format is used.

Additionally, this commit refactors big parts of code, unified usage of json_dict and manually generated dictionaries for textual output and improves code quality in many parts.
This commit is contained in:
Djordje Nedic
2022-07-14 13:39:53 +02:00
parent 5c1044d84d
commit 5ee663d592
10 changed files with 3223 additions and 507 deletions

View File

@@ -201,7 +201,7 @@ Similarly, this will print the same information for each component used in the p
Will print size information per source file in the project.
If you define variable ``-DOUTPUT_JSON=1`` when running CMake (or ``idf.py``), the output will be formatted as JSON not as human readable text. See ``idf.py-size`` for more information.
If you define the ``OUTPUT_FORMAT`` variable as ``csv`` or ``json`` when running CMake (or ``idf.py``), the output will be formatted in the specified format and not as human readable text. See ``idf.py-size`` for more information.
Reconfigure the project: reconfigure
------------------------------------