Граф коммитов

7 Коммитов

Автор SHA1 Сообщение Дата
dpranke 73fcb23c15 Switch MB to write the GN args to args.gn.
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
2016-04-14 01:44:13 +00:00
dpranke 37a665d265 Add FromGNArgs() to gn_helpers.
This adds a method to convert a string containing a list of
gn --args -like assignments to a python dict.

(ToGNString() already supports the opposite direction).

R=brettw@chromium.org, hashimoto@chromium.org
BUG=561142

Review URL: https://codereview.chromium.org/1847333005

Cr-Original-Commit-Position: refs/heads/master@{#385336}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 65d84dc0f629632d10687e2c85e8eea55362dc5d
2016-04-06 00:10:38 +00:00
hashimoto 03c04137bf Let gn_helpers.py handle unicode as str
For some reason, cros_chrome_sdk_unittests passes values as a unicode
object, instead of a str.

BUG=561142

Review URL: https://codereview.chromium.org/1851723002

Cr-Original-Commit-Position: refs/heads/master@{#384839}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7bf1d0a550d8bb3eea5e3a2a458c27512c3891a5
2016-04-04 01:03:19 +00:00
dpranke 26a4df329b Fix gn_helpers' parsing of bools.
R=brettw@chromium.org
BUG=561142

Review URL: https://codereview.chromium.org/1844823002

Cr-Original-Commit-Position: refs/heads/master@{#384752}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e031ec2442e681ee5f4e1ffba4629fc3fd28a997
2016-04-02 00:18:53 +00:00
brettw d70ec5d78b Use gn_helpers to deserialize GN lists.
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
2016-01-29 23:23:56 +00:00
brettw 6eae15d0ce Add a Python parser for GN types to gn_helpers.
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
2016-01-22 18:42:46 +00:00
brettw@chromium.org 3e4f5863a7 Add support for reading .gypi files.
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
2014-04-06 04:35:10 +00:00