mirror of
https://github.com/denoland/deno.git
synced 2025-01-03 12:58:54 -05:00
chore: download clang-format from google storage
This commit is contained in:
parent
565a21eb0e
commit
67d89ff692
3 changed files with 21 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import os
|
import os
|
||||||
from third_party import third_party_path, fix_symlinks, google_env
|
from third_party import third_party_path, fix_symlinks, google_env, clang_format_path
|
||||||
from util import root_path, run, find_exts
|
from util import root_path, run, find_exts
|
||||||
|
|
||||||
fix_symlinks()
|
fix_symlinks()
|
||||||
|
@ -12,8 +12,8 @@ rustfmt_config = os.path.join(tools_path, "rustfmt.toml")
|
||||||
|
|
||||||
os.chdir(root_path)
|
os.chdir(root_path)
|
||||||
|
|
||||||
# TODO(ry) Use third_party/depot_tools/clang-format.
|
run([clang_format_path, "-i", "-style", "Google"] +
|
||||||
run(["clang-format", "-i", "-style", "Google"] + find_exts("src", ".cc", ".h"))
|
find_exts("src", ".cc", ".h"))
|
||||||
|
|
||||||
for fn in ["BUILD.gn", ".gn"] + find_exts("build_extra", ".gn", ".gni"):
|
for fn in ["BUILD.gn", ".gn"] + find_exts("build_extra", ".gn", ".gni"):
|
||||||
run(["third_party/depot_tools/gn", "format", fn], env=google_env())
|
run(["third_party/depot_tools/gn", "format", fn], env=google_env())
|
||||||
|
|
|
@ -7,6 +7,7 @@ import distutils.spawn
|
||||||
|
|
||||||
third_party.fix_symlinks()
|
third_party.fix_symlinks()
|
||||||
third_party.download_gn()
|
third_party.download_gn()
|
||||||
|
third_party.download_clang_format()
|
||||||
third_party.download_clang()
|
third_party.download_clang()
|
||||||
third_party.maybe_download_sysroot()
|
third_party.maybe_download_sysroot()
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ third_party_path = tp()
|
||||||
depot_tools_path = tp("depot_tools")
|
depot_tools_path = tp("depot_tools")
|
||||||
rust_crates_path = tp("rust_crates")
|
rust_crates_path = tp("rust_crates")
|
||||||
gn_path = tp(depot_tools_path, "gn")
|
gn_path = tp(depot_tools_path, "gn")
|
||||||
|
clang_format_path = tp(depot_tools_path, "clang-format")
|
||||||
ninja_path = tp(depot_tools_path, "ninja")
|
ninja_path = tp(depot_tools_path, "ninja")
|
||||||
|
|
||||||
|
|
||||||
|
@ -141,27 +142,37 @@ def run_gclient_sync():
|
||||||
rmtree(depot_tools_temp_path)
|
rmtree(depot_tools_temp_path)
|
||||||
|
|
||||||
|
|
||||||
# Download gn from Google storage.
|
# Download the given item from Google storage.
|
||||||
def download_gn():
|
def download_from_google_storage(item, bucket):
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
sha1_file = "v8/buildtools/win/gn.exe.sha1"
|
sha1_file = "v8/buildtools/win/%s.exe.sha1" % item
|
||||||
elif sys.platform == 'darwin':
|
elif sys.platform == 'darwin':
|
||||||
sha1_file = "v8/buildtools/mac/gn.sha1"
|
sha1_file = "v8/buildtools/mac/%s.sha1" % item
|
||||||
elif sys.platform.startswith('linux'):
|
elif sys.platform.startswith('linux'):
|
||||||
sha1_file = "v8/buildtools/linux64/gn.sha1"
|
sha1_file = "v8/buildtools/linux64/%s.sha1" % item
|
||||||
|
|
||||||
run([
|
run([
|
||||||
"python",
|
"python",
|
||||||
tp('depot_tools/download_from_google_storage.py'),
|
tp('depot_tools/download_from_google_storage.py'),
|
||||||
'--platform=' + sys.platform,
|
'--platform=' + sys.platform,
|
||||||
'--no_auth',
|
'--no_auth',
|
||||||
'--bucket=chromium-gn',
|
'--bucket=%s' % bucket,
|
||||||
'--sha1_file',
|
'--sha1_file',
|
||||||
tp(sha1_file),
|
tp(sha1_file),
|
||||||
],
|
],
|
||||||
env=google_env())
|
env=google_env())
|
||||||
|
|
||||||
|
|
||||||
|
# Download gn from Google storage.
|
||||||
|
def download_gn():
|
||||||
|
download_from_google_storage('gn', 'chromium-gn')
|
||||||
|
|
||||||
|
|
||||||
|
# Download clang-format from Google storage.
|
||||||
|
def download_clang_format():
|
||||||
|
download_from_google_storage('clang-format', 'chromium-clang-format')
|
||||||
|
|
||||||
|
|
||||||
# Download clang by calling the clang update script.
|
# Download clang by calling the clang update script.
|
||||||
def download_clang():
|
def download_clang():
|
||||||
run(['python',
|
run(['python',
|
||||||
|
|
Loading…
Reference in a new issue