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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 'use_instrumented_libraries': '0', | 48 'use_instrumented_libraries': '0', |
49 'use_prebuilt_instrumented_libraries': '0', | 49 'use_prebuilt_instrumented_libraries': '0', |
50 'use_openssl': '0', | 50 'use_openssl': '0', |
51 'use_ozone': '0', | 51 'use_ozone': '0', |
52 'use_x11': '0', | 52 'use_x11': '0', |
53 'v8_use_external_startup_data': '1', | 53 'v8_use_external_startup_data': '1', |
54 'msvs_version': '0', | 54 'msvs_version': '0', |
55 } | 55 } |
56 | 56 |
57 | 57 |
| 58 def IsIsolateEmpty(isolate_path): |
| 59 """Returns whether there are no files in the .isolate.""" |
| 60 with open(isolate_path) as f: |
| 61 return "'files': []" in f.read() |
| 62 |
| 63 |
58 class Isolator(object): | 64 class Isolator(object): |
59 """Manages calls to isolate.py for the android test runner scripts.""" | 65 """Manages calls to isolate.py for the android test runner scripts.""" |
60 | 66 |
61 def __init__(self): | 67 def __init__(self): |
62 self._isolate_deps_dir = tempfile.mkdtemp() | 68 self._isolate_deps_dir = tempfile.mkdtemp() |
63 | 69 |
64 @property | 70 @property |
65 def isolate_deps_dir(self): | 71 def isolate_deps_dir(self): |
66 return self._isolate_deps_dir | 72 return self._isolate_deps_dir |
67 | 73 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 174 |
169 # Move everything in PRODUCT_DIR to top level. | 175 # Move everything in PRODUCT_DIR to top level. |
170 deps_product_dir = os.path.join( | 176 deps_product_dir = os.path.join( |
171 deps_out_dir, os.path.basename(constants.GetOutDirectory())) | 177 deps_out_dir, os.path.basename(constants.GetOutDirectory())) |
172 if os.path.isdir(deps_product_dir): | 178 if os.path.isdir(deps_product_dir): |
173 for p in os.listdir(deps_product_dir): | 179 for p in os.listdir(deps_product_dir): |
174 shutil.move(os.path.join(deps_product_dir, p), self._isolate_deps_dir) | 180 shutil.move(os.path.join(deps_product_dir, p), self._isolate_deps_dir) |
175 os.rmdir(deps_product_dir) | 181 os.rmdir(deps_product_dir) |
176 os.rmdir(deps_out_dir) | 182 os.rmdir(deps_out_dir) |
177 | 183 |
OLD | NEW |