Commit 3c2aa838 authored by Paweł Hajdan, Jr's avatar Paweł Hajdan, Jr Committed by Commit Bot

gclient flatten: handle GN settings

Bug: 570091
Change-Id: I5c7cf00722c47a2063a8635822c0bb270a26b524
Reviewed-on: https://chromium-review.googlesource.com/527632
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: 's avatarDirk Pranke <dpranke@chromium.org>
parent 52e8abc3
......@@ -1698,6 +1698,9 @@ def CMDflatten(parser, args):
return 1
flattened_deps = '\n'.join(
_GNSettingsToLines(
client.dependencies[0]._gn_args_file,
client.dependencies[0]._gn_args) +
_DepsToLines(deps) +
_HooksToLines('hooks', hooks) +
_HooksToLines('pre_deps_hooks', pre_deps_hooks) +
......@@ -1802,6 +1805,16 @@ def _AddDep(dep, deps, unpinned_deps):
unpinned_deps[dep.name] = dep
def _GNSettingsToLines(gn_args_file, gn_args):
s = []
if gn_args_file:
s.extend([
'gclient_gn_args_file = "%s"' % gn_args_file,
'gclient_gn_args = %r' % gn_args,
])
return s
def _DepsToLines(deps):
"""Converts |deps| dict to list of lines for output."""
s = ['deps = {']
......
......@@ -456,6 +456,11 @@ pre_deps_hooks = [
self._commit_git('repo_6', {
'DEPS': """
vars = {
'DummyVariable': 'repo',
}
gclient_gn_args_file = 'src/gclient.args'
gclient_gn_args = ['DummyVariable']
deps = {
'src/repo2': {
'url': '%(git_base)srepo_2@%(hash)s',
......
......@@ -570,6 +570,8 @@ class GClientSmokeGIT(GClientSmokeBase):
deps_contents = f.read()
self.assertEqual([
'gclient_gn_args_file = "src/gclient.args"',
'gclient_gn_args = [\'DummyVariable\']',
'deps = {',
' # src -> src/repo2 -> foo/bar',
' "foo/bar": {',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment