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

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

Issue 1409693004: Android test runner: Put isolate directory within out/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | no next file » | 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
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698