Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: gclient_utils.py

Issue 933383002: Run dartfmt when invoking git cl format. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: more style Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart_format.py ('k') | git_cl.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_utils.py
diff --git a/gclient_utils.py b/gclient_utils.py
index 96989a99e3dd54b78080728793a959368cda63d4..f80cd78e4a52e6ebb4abe5ab2fa35203191a9ce3 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -662,15 +662,8 @@ def GetMacWinOrLinux():
raise Error('Unknown platform: ' + sys.platform)
-def GetBuildtoolsPath():
- """Returns the full path to the buildtools directory.
- This is based on the root of the checkout containing the current directory."""
-
- # Overriding the build tools path by environment is highly unsupported and may
- # break without warning. Do not rely on this for anything important.
- override = os.environ.get('CHROMIUM_BUILDTOOLS_PATH')
- if override is not None:
- return override
+def GetPrimarySolutionPath():
+ """Returns the full path to the primary solution. (gclient_root + src)"""
gclient_root = FindGclientRoot(os.getcwd())
if not gclient_root:
@@ -691,9 +684,24 @@ def GetBuildtoolsPath():
# Some projects' top directory is not named 'src'.
source_dir_name = GetGClientPrimarySolutionName(gclient_root) or 'src'
- buildtools_path = os.path.join(gclient_root, source_dir_name, 'buildtools')
+ return os.path.join(gclient_root, source_dir_name)
+
+
+def GetBuildtoolsPath():
+ """Returns the full path to the buildtools directory.
+ This is based on the root of the checkout containing the current directory."""
+
+ # Overriding the build tools path by environment is highly unsupported and may
+ # break without warning. Do not rely on this for anything important.
+ override = os.environ.get('CHROMIUM_BUILDTOOLS_PATH')
+ if override is not None:
+ return override
+
+ primary_solution = GetPrimarySolutionPath()
+ buildtools_path = os.path.join(primary_solution, 'buildtools')
if not os.path.exists(buildtools_path):
# Buildtools may be in the gclient root.
+ gclient_root = FindGclientRoot(os.getcwd())
buildtools_path = os.path.join(gclient_root, 'buildtools')
return buildtools_path
« no previous file with comments | « dart_format.py ('k') | git_cl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698