-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JSON as a format option for targets
command in build_examples.py
#25810
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The `targets` command outputs the targets that are available for the `build` and `gen` commands in a string format that is easy to read but hard to parse. This change adds a option for the `targets` command to output JSON so that the available targets can be more easily parsed. To do this, ToDict methods were added to BuildTarget and TargetPart classes. When the `--format json` option is used with the `targets` command `build_examples.py` calls the ToDict method of each BuildTarget object and outputs to stdout a list of Dicts in JSON, one for each BuildTarget.
PR #25810: Size comparison from a4a407b to ba31e34 Full report (1 build for cc32xx)
|
PR #25810: Size comparison from a4a407b to 7ab15e0 Full report (1 build for cc32xx)
|
andy31415
reviewed
Mar 24, 2023
andy31415
reviewed
Mar 24, 2023
andy31415
reviewed
Mar 24, 2023
andy31415
reviewed
Mar 24, 2023
andy31415
reviewed
Mar 24, 2023
andy31415
reviewed
Mar 24, 2023
Simplied the code that ceates dictionaries and lists from data contained within the BuildTarget and TargetPart objects. Also, corrected some comments, and put List and Dict types where appropriate.
pullapprove
bot
requested review from
amitnj,
anush-apple,
arkq,
bzbarsky-apple,
carol-apple,
chrisdecenzo,
chshu,
chulspro,
cliffamzn,
CodeChronos928,
Damian-Nordic and
dhrishi
March 24, 2023 03:53
pullapprove
bot
requested review from
mrjerryjohns,
msandstedt,
mspang,
nivi-apple,
saurabhst,
selissia,
sharadb-amazon,
tcarmelveilleux,
tecimovic,
tehampson,
vijs,
vivien-apple,
woody-apple,
xylophone21,
younghak-hwang and
yunhanw-google
March 24, 2023 03:53
PR #25810: Size comparison from a4a407b to ccf235c Full report (1 build for cc32xx)
|
arkq
reviewed
Mar 24, 2023
andy31415
reviewed
Mar 24, 2023
BuildTarget ToDict method was incorrectly converting the fixed_targets list to a dictionary, losing data.
PR #25810: Size comparison from 275dbe1 to 2a9f942 Full report (1 build for cc32xx)
|
andy31415
approved these changes
Mar 24, 2023
Each time AppendFixedTargets method of BuildTarget is called, a list of TargetPart objects is appended to the fixed_targets list. This change perserves the developer's intent by keeping the list of lists structure intact rather than flatting it out into one list.
PR #25810: Size comparison from 7326cf8 to 466bdab Decreases (1 build for cc32xx)
Full report (1 build for cc32xx)
|
PR #25810: Size comparison from 7326cf8 to 3f775cf Decreases (1 build for cc32xx)
Full report (1 build for cc32xx)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
targets
command outputs the targets that are available for thebuild
andgen
commands in a string format that is easy to read but hard to parse. This change adds a option for thetargets
command to output JSON so that the available targets can be more easily parsed. To do this, ToDict methods were added to BuildTarget and TargetPart classes. When the--format json
option is used with thetargets
commandbuild_examples.py
calls the ToDict method of each BuildTarget object and outputs to stdout a list of Dicts in JSON, one for each BuildTarget.