diff options
author | Christian Moritz <chrmoritz@users.noreply.github.com> | 2019-09-12 00:22:23 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-09-11 18:22:23 -0400 |
commit | 19cd8deaf211fde97b9755a8cf93987a74d813b0 (patch) | |
tree | 8030418fb5ae753664157f89179ee2942192ad16 /tools/third_party.py | |
parent | 945dc7b84bc1a05f80b3b4e0b152be38d9f8a9bf (diff) |
tools: download gn from CIPD (#2912)
Diffstat (limited to 'tools/third_party.py')
-rw-r--r-- | tools/third_party.py | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/tools/third_party.py b/tools/third_party.py index 7ee8f22e4..02f0dbf68 100644 --- a/tools/third_party.py +++ b/tools/third_party.py @@ -4,6 +4,7 @@ import os from os import path +import re import site import sys from tempfile import mkdtemp @@ -208,9 +209,42 @@ def download_from_google_storage(item, bucket): env=google_env()) +# Download the given item from Chrome Infrastructure Package Deployment. +def download_from_cipd(item, version): + if sys.platform == 'win32': + root_dir = "v8/buildtools/win" + item += "windows-amd64" + elif sys.platform == 'darwin': + root_dir = "v8/buildtools/mac" + item += "mac-amd64" + elif sys.platform.startswith('linux'): + root_dir = "v8/buildtools/linux64" + item += "linux-amd64" + + # init cipd if necessary + if not os.path.exists(path.join(tp(root_dir), ".cipd")): + run([ + tp('depot_tools/cipd'), + 'init', + tp(root_dir), + '-force', + ], + env=google_env()) + + run([ + tp('depot_tools/cipd'), + 'install', + item, + 'git_revision:' + version, + '-root', + tp(root_dir), + ], + env=google_env()) + + # Download gn from Google storage. def download_gn(): - download_from_google_storage('gn', 'chromium-gn') + download_from_cipd('gn/gn/', '152c5144ceed9592c20f0c8fd55769646077569b') # Download clang-format from Google storage. |