diff --git a/recipe_modules/gclient/api.py b/recipe_modules/gclient/api.py index 1b705d5b35..98100c2058 100644 --- a/recipe_modules/gclient/api.py +++ b/recipe_modules/gclient/api.py @@ -126,11 +126,10 @@ class GclientApi(recipe_api.RecipeApi): self._spec_alias = None def get_config_defaults(self): - ret = { - 'USE_MIRROR': self.use_mirror + return { + 'USE_MIRROR': self.use_mirror, + 'CACHE_DIR': self.m.path['git_cache'], } - ret['CACHE_DIR'] = self.m.path['root'].join('git_cache') - return ret def resolve_revision(self, revision): if hasattr(revision, 'resolve'): diff --git a/recipe_modules/gclient/config.py b/recipe_modules/gclient/config.py index b8152734b1..c300edd506 100644 --- a/recipe_modules/gclient/config.py +++ b/recipe_modules/gclient/config.py @@ -14,7 +14,7 @@ def BaseConfig(USE_MIRROR=True, GIT_MODE=False, CACHE_DIR=None, PATCH_PROJECT=None, BUILDSPEC_VERSION=None, **_kwargs): deps = '.DEPS.git' if GIT_MODE else 'DEPS' - cache_dir = str(CACHE_DIR) if GIT_MODE and CACHE_DIR else None + cache_dir = str(CACHE_DIR) if CACHE_DIR else None return ConfigGroup( solutions = ConfigList( lambda: ConfigGroup( diff --git a/recipe_modules/gclient/example.expected/basic.json b/recipe_modules/gclient/example.expected/basic.json index 46c74809df..7e3481be47 100644 --- a/recipe_modules/gclient/example.expected/basic.json +++ b/recipe_modules/gclient/example.expected/basic.json @@ -89,7 +89,7 @@ "RECIPE_PACKAGE[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" ], "cwd": "[SLAVE_BUILD]/src/third_party", "env": { diff --git a/recipe_modules/gclient/example.expected/revision.json b/recipe_modules/gclient/example.expected/revision.json index f954fd9c14..a3baf68b4d 100644 --- a/recipe_modules/gclient/example.expected/revision.json +++ b/recipe_modules/gclient/example.expected/revision.json @@ -91,7 +91,7 @@ "RECIPE_PACKAGE[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" ], "cwd": "[SLAVE_BUILD]/src/third_party", "env": { diff --git a/recipe_modules/gclient/example.expected/tryserver.json b/recipe_modules/gclient/example.expected/tryserver.json index c4959cd37b..50df3d7a21 100644 --- a/recipe_modules/gclient/example.expected/tryserver.json +++ b/recipe_modules/gclient/example.expected/tryserver.json @@ -91,7 +91,7 @@ "RECIPE_PACKAGE[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" ], "cwd": "[SLAVE_BUILD]/src/third_party", "env": {