This CL switches MB from passing the gn arguments on the
command line via --args to actually writing them to an
args.gn file. This makes some of the escaping slightly cleaner
and also will enable us to embed import() lines in a follow-on
CL, so that we can use //build/args templates.
R=brettw@chromium.org
BUG=602528
Review URL: https://codereview.chromium.org/1880903002
Cr-Original-Commit-Position: refs/heads/master@{#387205}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: eca4a786d114c8a36583503f3d251a37dcffa023
The Android build code doesn't properly unescape the GN lists, use the official Python GN parser instead of ast for the zip script.
Document what should be done for build_utils, but don't fix it due to cast shell build errors as explained in the comment I added.
Update mojo zip script to use the gn helpers.
BUG=573132, 571022
Review URL: https://codereview.chromium.org/1618243004
Cr-Original-Commit-Position: refs/heads/master@{#372461}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 81687d8362fd2dbf0acab8f1deee5b91ee1e5a49
Some scripts take serialized GN values including strings and lists. These are serialized and escaped according to GN rules. In particular, the string escaping is not possible to duplicate with Python's "ast" module. This simple parser will convert values properly.
Add unit tests for new code, as well as existing code in gn_helpers.
Fix omissions in existing ToGNString code.
BUG=573132,571022
Review URL: https://codereview.chromium.org/1553993002
Cr-Original-Commit-Position: refs/heads/master@{#371000}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9dffb54bc426d84e4a2a1a6fb2989bf53237f5a2
Adds support for a new value type, a dictionary. To script it looks the same as a scope, but the existing scope didn't have the right memory management semantics for this.
Adds a new input conversion mode to interpret the result of a script as a GN block (basically an eval) and get the result in a dictionary. This allows returning named sets of things from a script. Updates the accessor and defined stuff to work with this new type.
Adds some features to the input file manager so that when we do dynamic reading from a script we keep the text of the read around which means we can give proper errors that refer to the script output, and don't have to do the weird recursive set origin thing to clear out the pointers that became invalid when the InputFile went out of scope.
This allows us to give better error messages when parsing input. The error handling in the input conversion code is changed accordingly.
Checks for unused variables both in code that instantiates a template, and in the template code itself.
Adds a shared python script for outputting values from Python to GN.
Adds a python script to read .gypi files and return the value as a GN scope.
BUG=
R=dpranke@chromium.org, scottmg@chromium.org
Review URL: https://codereview.chromium.org/223783005
git-svn-id: http://src.chromium.org/svn/trunk/src/build@262045 4ff67af0-8c30-449e-8e8b-ad334ec8d88c