| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 """ Install all executables, and any runtime resources that are needed by | |
| 7 *both* Test and Bench builders. """ | |
| 8 | |
| 9 from build_step import BuildStep | |
| 10 from utils import old_gs_utils as gs_utils | |
| 11 import os | |
| 12 import sys | |
| 13 | |
| 14 | |
| 15 class Install(BuildStep): | |
| 16 def _Run(self): | |
| 17 # Push the SKPs to the device. | |
| 18 skps_need_updating = True | |
| 19 try: | |
| 20 # Only push if the existing set is out of date. | |
| 21 host_timestamp = open(os.path.join(self.skp_dir, | |
| 22 gs_utils.TIMESTAMP_COMPLETED_FILENAME)).read() | |
| 23 device_timestamp = self._flavor_utils.ReadFileOnDevice( | |
| 24 os.path.join(self._device_dirs.SKPDir(), | |
| 25 gs_utils.TIMESTAMP_COMPLETED_FILENAME)) | |
| 26 if host_timestamp == device_timestamp: | |
| 27 print 'SKPs are up to date. Skipping.' | |
| 28 skps_need_updating = False | |
| 29 else: | |
| 30 print 'SKP timestamp does not match:\n%s\n%s\nPushing SKPs...' % ( | |
| 31 device_timestamp, host_timestamp) | |
| 32 except Exception as e: | |
| 33 print 'Could not get timestamps: %s' % e | |
| 34 if skps_need_updating: | |
| 35 self._flavor_utils.CopyDirectoryContentsToDevice( | |
| 36 self.skp_dir, self._device_dirs.SKPDir()) | |
| 37 | |
| 38 # Push resources to the device. | |
| 39 self._flavor_utils.CopyDirectoryContentsToDevice( | |
| 40 self._resource_dir, self._device_dirs.ResourceDir()) | |
| 41 | |
| 42 # Initialize a clean scratch directory. | |
| 43 self._flavor_utils.CreateCleanDeviceDirectory(self._device_dirs.TmpDir()) | |
| 44 | |
| 45 # Install the Skia executables. | |
| 46 self._flavor_utils.Install() | |
| 47 | |
| 48 if '__main__' == __name__: | |
| 49 sys.exit(BuildStep.RunBuildStep(Install)) | |
| OLD | NEW |