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 | |
64 class Isolator(object): | 58 class Isolator(object): |
65 """Manages calls to isolate.py for the android test runner scripts.""" | 59 """Manages calls to isolate.py for the android test runner scripts.""" |
66 | 60 |
67 def __init__(self): | 61 def __init__(self): |
68 self._isolate_deps_dir = tempfile.mkdtemp() | 62 self._isolate_deps_dir = tempfile.mkdtemp() |
69 | 63 |
70 @property | 64 @property |
71 def isolate_deps_dir(self): | 65 def isolate_deps_dir(self): |
72 return self._isolate_deps_dir | 66 return self._isolate_deps_dir |
73 | 67 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 168 |
175 # Move everything in PRODUCT_DIR to top level. | 169 # Move everything in PRODUCT_DIR to top level. |
176 deps_product_dir = os.path.join( | 170 deps_product_dir = os.path.join( |
177 deps_out_dir, os.path.basename(constants.GetOutDirectory())) | 171 deps_out_dir, os.path.basename(constants.GetOutDirectory())) |
178 if os.path.isdir(deps_product_dir): | 172 if os.path.isdir(deps_product_dir): |
179 for p in os.listdir(deps_product_dir): | 173 for p in os.listdir(deps_product_dir): |
180 shutil.move(os.path.join(deps_product_dir, p), self._isolate_deps_dir) | 174 shutil.move(os.path.join(deps_product_dir, p), self._isolate_deps_dir) |
181 os.rmdir(deps_product_dir) | 175 os.rmdir(deps_product_dir) |
182 os.rmdir(deps_out_dir) | 176 os.rmdir(deps_out_dir) |
183 | 177 |
OLD | NEW |