| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 | 5 |
| 6 # pylint: disable=W0201 | 6 # pylint: disable=W0201 |
| 7 | 7 |
| 8 | 8 |
| 9 from recipe_engine import recipe_api | 9 from recipe_engine import recipe_api |
| 10 | 10 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 path = os.path.join(src, pattern) | 108 path = os.path.join(src, pattern) |
| 109 for f in glob.glob(path): | 109 for f in glob.glob(path): |
| 110 dst_path = os.path.join(dst, os.path.relpath(f, src)) | 110 dst_path = os.path.join(dst, os.path.relpath(f, src)) |
| 111 if not os.path.isdir(os.path.dirname(dst_path)): | 111 if not os.path.isdir(os.path.dirname(dst_path)): |
| 112 os.makedirs(os.path.dirname(dst_path)) | 112 os.makedirs(os.path.dirname(dst_path)) |
| 113 print 'Copying build product %%s to %%s' %% (f, dst_path) | 113 print 'Copying build product %%s to %%s' %% (f, dst_path) |
| 114 shutil.move(f, dst_path) | 114 shutil.move(f, dst_path) |
| 115 ''' % str(BUILD_PRODUCTS_ISOLATE_WHITELIST), | 115 ''' % str(BUILD_PRODUCTS_ISOLATE_WHITELIST), |
| 116 args=[src, dst], | 116 args=[src, dst], |
| 117 infra_step=True) | 117 infra_step=True) |
| 118 | |
| 119 def ccache(self): | |
| 120 if not self._checked_for_ccache: | |
| 121 self._checked_for_ccache = True | |
| 122 if not self.m.platform.is_win: | |
| 123 result = self( | |
| 124 self.m.python.inline, | |
| 125 name='has ccache?', | |
| 126 program='''import json | |
| 127 import subprocess | |
| 128 import sys | |
| 129 | |
| 130 ccache = None | |
| 131 try: | |
| 132 ccache = subprocess.check_output(['which', 'ccache']).rstrip() | |
| 133 except: | |
| 134 pass | |
| 135 print json.dumps({'ccache': ccache}) | |
| 136 ''', | |
| 137 stdout=self.m.json.output(), | |
| 138 infra_step=True, | |
| 139 abort_on_failure=False, | |
| 140 fail_build_on_failure=False) | |
| 141 if result and result.stdout and result.stdout.get('ccache'): | |
| 142 self._ccache = result.stdout['ccache'] | |
| 143 | |
| 144 return self._ccache | |
| OLD | NEW |