Commit 93d2dc64 authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

bind-gen: Get rid of gclient_paths.py

It turned out that gclient_paths.py seems not working as expected
on canary build (could be a conflict with Google-internal src).

Implements the similar (but simplified) logic without depending on
unknown factors.

Bug: 839389
Change-Id: I70032d60098c018f139bdceb78ea73996393ddfc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2029405Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736850}
parent 6b93bd9a
......@@ -21,8 +21,6 @@ def _setup_sys_path():
# //third_party/blink/renderer/build/scripts/blinkbuild
os.path.join(root_dir, 'third_party', 'blink', 'renderer', 'build',
'scripts'),
# //third_party/depot_tools
os.path.join(root_dir, 'third_party', 'depot_tools'),
# //third_party/mako/mako
os.path.join(root_dir, 'third_party', 'mako'),
] + sys.path
......@@ -47,7 +45,7 @@ def init(root_src_dir, root_gen_dir, component_reldirs):
"//out/Default/gen" in GN.
component_reldirs: Pairs of component and output directory.
"""
style_format.init()
style_format.init(root_src_dir)
PathManager.init(
root_src_dir=root_src_dir,
......
......@@ -4,30 +4,43 @@
import os.path
import subprocess
import gclient_paths
import sys
_clang_format_command_path = None
_gn_command_path = None
def init():
def init(root_src_dir):
global _clang_format_command_path
global _gn_command_path
assert _clang_format_command_path is None
assert _gn_command_path is None
root_src_dir = os.path.abspath(root_src_dir)
# Determine //buildtools/<platform>/ directory
if sys.platform.startswith("linux"):
platform = "linux64"
exe_suffix = ""
elif sys.platform.startswith("darwin"):
platform = "mac"
exe_suffix = ""
elif sys.platform.startswith(("cygwin", "win")):
platform = "win"
exe_suffix = ".exe"
else:
assert False, "Unknown platform: {}".format(sys.platform)
buildtools_platform_dir = os.path.join(root_src_dir, "buildtools",
platform)
# //buildtools/<platform>/clang-format
command_name = "clang-format{}".format(gclient_paths.GetExeSuffix())
command_path = os.path.abspath(
os.path.join(gclient_paths.GetBuildtoolsPlatformBinaryPath(),
command_name))
_clang_format_command_path = command_path
_clang_format_command_path = os.path.join(
buildtools_platform_dir, "clang-format{}".format(exe_suffix))
# //buildtools/<platform>/gn
command_name = "gn{}".format(gclient_paths.GetExeSuffix())
command_path = os.path.abspath(
os.path.join(gclient_paths.GetBuildtoolsPlatformBinaryPath(),
command_name))
_gn_command_path = command_path
_gn_command_path = os.path.join(buildtools_platform_dir,
"gn{}".format(exe_suffix))
def auto_format(contents, filename):
......
# Generated by running:
# build/print_python_deps.py --root third_party/blink/renderer/bindings/scripts --output third_party/blink/renderer/bindings/scripts/generate_bindings.pydeps third_party/blink/renderer/bindings/scripts/generate_bindings.py
../../../../depot_tools/gclient_paths.py
../../../../depot_tools/gclient_utils.py
../../../../depot_tools/subprocess2.py
../../../../mako/mako/__init__.py
../../../../mako/mako/_ast_util.py
../../../../mako/mako/ast.py
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment