| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Supports inferring locations of files in default checkout layouts. | 5 """Supports inferring locations of files in default checkout layouts. |
| 6 | 6 |
| 7 These functions allow devtools scripts to work out-of-the-box with regular Mojo | 7 These functions allow devtools scripts to work out-of-the-box with regular Mojo |
| 8 checkouts. | 8 checkouts. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 paths = {} | 46 paths = {} |
| 47 paths['root'] = root_path | 47 paths['root'] = root_path |
| 48 build_dir_path = os.path.join(root_path, out_build_dir) | 48 build_dir_path = os.path.join(root_path, out_build_dir) |
| 49 paths['build'] = build_dir_path | 49 paths['build'] = build_dir_path |
| 50 if is_android: | 50 if is_android: |
| 51 paths['shell'] = os.path.join(build_dir_path, 'apks', 'MojoShell.apk') | 51 paths['shell'] = os.path.join(build_dir_path, 'apks', 'MojoShell.apk') |
| 52 paths['adb'] = os.path.join(root_path, 'third_party', 'android_tools', | 52 paths['adb'] = os.path.join(root_path, 'third_party', 'android_tools', |
| 53 'sdk', 'platform-tools', 'adb') | 53 'sdk', 'platform-tools', 'adb') |
| 54 else: | 54 else: |
| 55 paths['shell'] = os.path.join(build_dir_path, 'mojo_shell') | 55 paths['shell'] = os.path.join(build_dir_path, 'mojo_shell') |
| 56 | |
| 57 paths['sky_packages'] = os.path.join(build_dir_path, 'gen', 'dart-pkg', | |
| 58 'packages') | |
| 59 return paths, None | 56 return paths, None |
| 60 | 57 |
| 61 | 58 |
| 62 # Based on Chromium //tools/find_depot_tools.py. | 59 # Based on Chromium //tools/find_depot_tools.py. |
| 63 def find_depot_tools(): | 60 def find_depot_tools(): |
| 64 """Searches for depot_tools. | 61 """Searches for depot_tools. |
| 65 | 62 |
| 66 Returns: | 63 Returns: |
| 67 Path to the depot_tools checkout present on the machine, None if not found. | 64 Path to the depot_tools checkout present on the machine, None if not found. |
| 68 """ | 65 """ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 80 # Rare case, it's not even in PATH, look upward up to root. | 77 # Rare case, it's not even in PATH, look upward up to root. |
| 81 root_dir = os.path.dirname(os.path.abspath(__file__)) | 78 root_dir = os.path.dirname(os.path.abspath(__file__)) |
| 82 previous_dir = os.path.abspath(__file__) | 79 previous_dir = os.path.abspath(__file__) |
| 83 while root_dir and root_dir != previous_dir: | 80 while root_dir and root_dir != previous_dir: |
| 84 i = os.path.join(root_dir, 'depot_tools') | 81 i = os.path.join(root_dir, 'depot_tools') |
| 85 if _is_real_depot_tools(i): | 82 if _is_real_depot_tools(i): |
| 86 return i | 83 return i |
| 87 previous_dir = root_dir | 84 previous_dir = root_dir |
| 88 root_dir = os.path.dirname(root_dir) | 85 root_dir = os.path.dirname(root_dir) |
| 89 return None | 86 return None |
| OLD | NEW |