Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: build/android/pylib/utils/isolator.py

Issue 1571803002: [Android] Prepare build/android/ for catapult+devil. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@create-device-library-links
Patch Set: rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/pylib/utils/findbugs.py ('k') | build/android/pylib/utils/logging_utils.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « build/android/pylib/utils/findbugs.py ('k') | build/android/pylib/utils/logging_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698