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 |
11 | 11 |
12 from devil.utils import cmd_helper | 12 from devil.utils import cmd_helper |
13 from pylib import constants | 13 from pylib import constants |
| 14 from pylib.constants import host_paths |
14 | 15 |
15 | 16 |
16 _ISOLATE_SCRIPT = os.path.join( | 17 _ISOLATE_SCRIPT = os.path.join( |
17 constants.DIR_SOURCE_ROOT, 'tools', 'swarming_client', 'isolate.py') | 18 host_paths.DIR_SOURCE_ROOT, 'tools', 'swarming_client', 'isolate.py') |
18 | 19 |
19 | 20 |
20 def DefaultPathVariables(): | 21 def DefaultPathVariables(): |
21 return { | 22 return { |
22 'DEPTH': constants.DIR_SOURCE_ROOT, | 23 'DEPTH': host_paths.DIR_SOURCE_ROOT, |
23 'PRODUCT_DIR': constants.GetOutDirectory(), | 24 'PRODUCT_DIR': constants.GetOutDirectory(), |
24 } | 25 } |
25 | 26 |
26 | 27 |
27 def DefaultConfigVariables(): | 28 def DefaultConfigVariables(): |
28 # Note: This list must match the --config-vars in build/isolate.gypi | 29 # Note: This list must match the --config-vars in build/isolate.gypi |
29 return { | 30 return { |
30 'CONFIGURATION_NAME': constants.GetBuildType(), | 31 'CONFIGURATION_NAME': constants.GetBuildType(), |
31 'OS': 'android', | 32 'OS': 'android', |
32 'asan': '0', | 33 'asan': '0', |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 Moves pak files from the output directory to to <isolate_deps_dir>/paks | 153 Moves pak files from the output directory to to <isolate_deps_dir>/paks |
153 Moves files from the product directory to <isolate_deps_dir> | 154 Moves files from the product directory to <isolate_deps_dir> |
154 """ | 155 """ |
155 # On Android, all pak files need to be in the top-level 'paks' directory. | 156 # On Android, all pak files need to be in the top-level 'paks' directory. |
156 paks_dir = os.path.join(self._isolate_deps_dir, 'paks') | 157 paks_dir = os.path.join(self._isolate_deps_dir, 'paks') |
157 os.mkdir(paks_dir) | 158 os.mkdir(paks_dir) |
158 | 159 |
159 deps_out_dir = os.path.join( | 160 deps_out_dir = os.path.join( |
160 self._isolate_deps_dir, | 161 self._isolate_deps_dir, |
161 os.path.relpath(os.path.join(constants.GetOutDirectory(), os.pardir), | 162 os.path.relpath(os.path.join(constants.GetOutDirectory(), os.pardir), |
162 constants.DIR_SOURCE_ROOT)) | 163 host_paths.DIR_SOURCE_ROOT)) |
163 for root, _, filenames in os.walk(deps_out_dir): | 164 for root, _, filenames in os.walk(deps_out_dir): |
164 for filename in fnmatch.filter(filenames, '*.pak'): | 165 for filename in fnmatch.filter(filenames, '*.pak'): |
165 shutil.move(os.path.join(root, filename), paks_dir) | 166 shutil.move(os.path.join(root, filename), paks_dir) |
166 | 167 |
167 # Move everything in PRODUCT_DIR to top level. | 168 # Move everything in PRODUCT_DIR to top level. |
168 deps_product_dir = os.path.join( | 169 deps_product_dir = os.path.join( |
169 deps_out_dir, os.path.basename(constants.GetOutDirectory())) | 170 deps_out_dir, os.path.basename(constants.GetOutDirectory())) |
170 if os.path.isdir(deps_product_dir): | 171 if os.path.isdir(deps_product_dir): |
171 for p in os.listdir(deps_product_dir): | 172 for p in os.listdir(deps_product_dir): |
172 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) |
173 os.rmdir(deps_product_dir) | 174 os.rmdir(deps_product_dir) |
174 os.rmdir(deps_out_dir) | 175 os.rmdir(deps_out_dir) |
175 | 176 |
OLD | NEW |