From b13fba7efb083a8bb4b7ed47b876a91df3a010d3 Mon Sep 17 00:00:00 2001 From: Michael Moss Date: Wed, 31 Jan 2018 17:19:57 -0800 Subject: [PATCH] Allow bools in gclient recipe custom_vars. This has been supported in gclient, and used in DEPS, since https://crrev.com/c/687496. R=dpranke@google.com, iannucci@google.com Bug: 570091,807318 Change-Id: I59935625e3bae6010a371ad7bb1413e177a09176 Reviewed-on: https://chromium-review.googlesource.com/896835 Reviewed-by: Dirk Pranke Commit-Queue: Michael Moss --- recipes/recipe_modules/gclient/config.py | 2 +- .../recipe_modules/gclient/examples/full.expected/basic.json | 2 +- .../recipe_modules/gclient/examples/full.expected/buildbot.json | 2 +- .../recipe_modules/gclient/examples/full.expected/revision.json | 2 +- .../gclient/examples/full.expected/tryserver.json | 2 +- recipes/recipe_modules/gclient/examples/full.py | 1 + 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/recipes/recipe_modules/gclient/config.py b/recipes/recipe_modules/gclient/config.py index 77b412dd2..f9a9fe538 100644 --- a/recipes/recipe_modules/gclient/config.py +++ b/recipes/recipe_modules/gclient/config.py @@ -23,7 +23,7 @@ def BaseConfig(USE_MIRROR=True, CACHE_DIR=None, hidden=False), managed = Single(bool, empty_val=True, required=False, hidden=False), custom_deps = Dict(value_type=(basestring, types.NoneType)), - custom_vars = Dict(value_type=basestring), + custom_vars = Dict(value_type=(basestring, types.BooleanType)), safesync_url = Single(basestring, required=False), revision = Single( diff --git a/recipes/recipe_modules/gclient/examples/full.expected/basic.json b/recipes/recipe_modules/gclient/examples/full.expected/basic.json index 17843b505..8df05f441 100644 --- a/recipes/recipe_modules/gclient/examples/full.expected/basic.json +++ b/recipes/recipe_modules/gclient/examples/full.expected/basic.json @@ -6,7 +6,7 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = '[ROOT]/git_cache'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]" + "cache_dir = '[ROOT]/git_cache'\nsolutions = [{'custom_vars': {'string_var': 'string_val', 'true_var': True}, 'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]" ], "env": { "PATH": ":RECIPE_PACKAGE_REPO[depot_tools]" diff --git a/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json b/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json index 359d7cef4..52cdcba2c 100644 --- a/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json +++ b/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json @@ -6,7 +6,7 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = '[ROOT]/git_cache'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]" + "cache_dir = '[ROOT]/git_cache'\nsolutions = [{'custom_vars': {'string_var': 'string_val', 'true_var': True}, 'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]" ], "env": { "PATH": ":RECIPE_PACKAGE_REPO[depot_tools]" diff --git a/recipes/recipe_modules/gclient/examples/full.expected/revision.json b/recipes/recipe_modules/gclient/examples/full.expected/revision.json index 6bc53d903..9af753b90 100644 --- a/recipes/recipe_modules/gclient/examples/full.expected/revision.json +++ b/recipes/recipe_modules/gclient/examples/full.expected/revision.json @@ -6,7 +6,7 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = '[ROOT]/git_cache'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]" + "cache_dir = '[ROOT]/git_cache'\nsolutions = [{'custom_vars': {'string_var': 'string_val', 'true_var': True}, 'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]" ], "env": { "PATH": ":RECIPE_PACKAGE_REPO[depot_tools]" diff --git a/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json b/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json index 17843b505..8df05f441 100644 --- a/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json +++ b/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json @@ -6,7 +6,7 @@ "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = '[ROOT]/git_cache'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]" + "cache_dir = '[ROOT]/git_cache'\nsolutions = [{'custom_vars': {'string_var': 'string_val', 'true_var': True}, 'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]" ], "env": { "PATH": ":RECIPE_PACKAGE_REPO[depot_tools]" diff --git a/recipes/recipe_modules/gclient/examples/full.py b/recipes/recipe_modules/gclient/examples/full.py index 6d5e9b890..80c877ec0 100644 --- a/recipes/recipe_modules/gclient/examples/full.py +++ b/recipes/recipe_modules/gclient/examples/full.py @@ -51,6 +51,7 @@ def RunSteps(api): soln.name = 'src' soln.url = 'https://chromium.googlesource.com/chromium/src.git' soln.revision = api.properties.get('revision') + soln.custom_vars = {'string_var': 'string_val', 'true_var': True} src_cfg.parent_got_revision_mapping['parent_got_revision'] = 'got_revision' api.gclient.c = src_cfg api.gclient.checkout()