OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import fnmatch | 5 import fnmatch |
6 import glob | 6 import glob |
7 import os | 7 import os |
8 import shutil | 8 import shutil |
9 import sys | 9 import sys |
10 import tempfile | 10 import tempfile |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 'use_x11': '0', | 51 'use_x11': '0', |
52 'v8_use_external_startup_data': '1', | 52 'v8_use_external_startup_data': '1', |
53 'msvs_version': '0', | 53 'msvs_version': '0', |
54 } | 54 } |
55 | 55 |
56 | 56 |
57 class Isolator(object): | 57 class Isolator(object): |
58 """Manages calls to isolate.py for the android test runner scripts.""" | 58 """Manages calls to isolate.py for the android test runner scripts.""" |
59 | 59 |
60 def __init__(self): | 60 def __init__(self): |
61 self._isolate_deps_dir = tempfile.mkdtemp() | 61 # Put within output directory to ensure that hardlinks can be used. |
| 62 self._isolate_deps_dir = tempfile.mkdtemp(prefix='isolate-', |
| 63 dir=constants.GetOutDirectory()) |
62 | 64 |
63 @property | 65 @property |
64 def isolate_deps_dir(self): | 66 def isolate_deps_dir(self): |
65 return self._isolate_deps_dir | 67 return self._isolate_deps_dir |
66 | 68 |
67 def Clear(self): | 69 def Clear(self): |
68 """Deletes the isolate dependency directory.""" | 70 """Deletes the isolate dependency directory.""" |
69 if os.path.exists(self._isolate_deps_dir): | 71 if os.path.exists(self._isolate_deps_dir): |
70 shutil.rmtree(self._isolate_deps_dir) | 72 shutil.rmtree(self._isolate_deps_dir) |
71 | 73 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 shutil.move(os.path.join(root, filename), paks_dir) | 167 shutil.move(os.path.join(root, filename), paks_dir) |
166 | 168 |
167 # Move everything in PRODUCT_DIR to top level. | 169 # Move everything in PRODUCT_DIR to top level. |
168 deps_product_dir = os.path.join(deps_out_dir, constants.GetBuildType()) | 170 deps_product_dir = os.path.join(deps_out_dir, constants.GetBuildType()) |
169 if os.path.isdir(deps_product_dir): | 171 if os.path.isdir(deps_product_dir): |
170 for p in os.listdir(deps_product_dir): | 172 for p in os.listdir(deps_product_dir): |
171 shutil.move(os.path.join(deps_product_dir, p), self._isolate_deps_dir) | 173 shutil.move(os.path.join(deps_product_dir, p), self._isolate_deps_dir) |
172 os.rmdir(deps_product_dir) | 174 os.rmdir(deps_product_dir) |
173 os.rmdir(deps_out_dir) | 175 os.rmdir(deps_out_dir) |
174 | 176 |
OLD | NEW |