Chromium Code Reviews| Index: gclient_utils.py |
| =================================================================== |
| --- gclient_utils.py (revision 277924) |
| +++ gclient_utils.py (working copy) |
| @@ -650,6 +650,37 @@ |
| raise Error('Unknown platform: ' + sys.platform) |
| +def GetBuildtoolsPath(): |
|
M-A Ruel
2014/06/18 00:55:36
Why put these functions here and not put it in gn.
brettw
2014/06/18 05:41:18
I think some more stuff will be added to buildtool
|
| + """Returns the full path to the buildtools directory. |
| + This is based on the root of the checkout containing the current directory.""" |
| + gclient_root = FindGclientRoot(os.getcwd()) |
| + if not gclient_root: |
| + return None |
| + return os.path.join(gclient_root, 'src', 'buildtools') |
| + |
| + |
| +def GetBuildtoolsPlatformBinaryPath(): |
| + """Returns the full path to the binary directory for the current platform.""" |
| + # Mac and Windows just have one directory, Linux has two according to whether |
| + # it's 32 or 64 bits. |
| + buildtools_path = GetBuildtoolsPath() |
| + if not buildtools_path: |
| + return None; |
| + |
| + if sys.platform.startswith(('cygwin', 'win')): |
| + subdir = 'win' |
| + elif sys.platform == 'darwin': |
| + subdir = 'mac' |
|
iannucci
2014/06/20 22:24:22
Can we keep the naming scheme uniform across all p
brettw
2014/06/20 23:43:37
That doesn't really make sense. The idea here is t
|
| + elif sys.platform.startswith('linux'): |
| + if sys.maxsize > 2**32: |
| + subdir = 'linux64' |
| + else: |
| + subdir = 'linux32' |
| + else: |
| + raise Error('Unknown platform: ' + sys.platform) |
| + return os.path.join(buildtools_path, subdir) |
| + |
| + |
| def GetExeSuffix(): |
| """Returns '' or '.exe' depending on how executables work on this platform.""" |
| if sys.platform.startswith(('cygwin', 'win')): |