(v8_path)
| 18 | |
| 19 | def EnsureDepotTools(v8_path, fetch_if_not_exist): |
| 20 | def _Get(v8_path): |
| 21 | depot_tools = os.path.join(v8_path, "depot_tools") |
| 22 | try: |
| 23 | gclient_path = os.path.join(depot_tools, "gclient.py") |
| 24 | if os.path.isfile(gclient_path): |
| 25 | return depot_tools |
| 26 | except: |
| 27 | pass |
| 28 | if fetch_if_not_exist: |
| 29 | print("Checking out depot_tools.") |
| 30 | # shell=True needed on Windows to resolve git.bat. |
| 31 | subprocess.check_call("git clone {} {}".format( |
| 32 | pipes.quote(DEPOT_TOOLS_URL), |
| 33 | pipes.quote(depot_tools)), shell=True) |
| 34 | # Using check_output to hide warning messages. |
| 35 | subprocess.check_output( |
| 36 | [sys.executable, gclient_path, "metrics", "--opt-out"], |
| 37 | cwd=depot_tools) |
| 38 | return depot_tools |
| 39 | return None |
| 40 | depot_tools = _Get(v8_path) |
| 41 | assert depot_tools is not None |
| 42 | print("Using depot tools in %s" % depot_tools) |
no test coverage detected
searching dependent graphs…