OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 """ Utilities for Android build steps. """ | 5 """ Utilities for Android build steps. """ |
6 | 6 |
7 from default_build_step_utils import DefaultBuildStepUtils, DeviceDirs | 7 from default_build_step_utils import DefaultBuildStepUtils, DeviceDirs |
8 from utils import android_utils | 8 from utils import android_utils |
9 from utils import gs_utils | 9 from utils import gs_utils |
10 from utils import shell_utils | 10 from utils import shell_utils |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 # it to come back up. | 112 # it to come back up. |
113 shell_utils.run([android_utils.PATH_TO_ADB, '-s', self._serial, | 113 shell_utils.run([android_utils.PATH_TO_ADB, '-s', self._serial, |
114 'reboot']) | 114 'reboot']) |
115 time.sleep(60) | 115 time.sleep(60) |
116 android_utils.StopShell(self._serial) | 116 android_utils.StopShell(self._serial) |
117 else: | 117 else: |
118 android_utils.ADBKill(self._serial, 'com.skia', kill_app=True) | 118 android_utils.ADBKill(self._serial, 'com.skia', kill_app=True) |
119 | 119 |
120 def RunGYP(self): | 120 def RunGYP(self): |
121 print 'android_ninja handles gyp' | 121 print 'android_ninja handles gyp' |
122 pass | |
123 | 122 |
124 def Compile(self, target): | 123 def Compile(self, target): |
125 """ Compile the Skia executables. """ | 124 """ Compile the Skia executables. """ |
126 os.environ['SKIA_ANDROID_VERBOSE_SETUP'] = '1' | 125 os.environ['SKIA_ANDROID_VERBOSE_SETUP'] = '1' |
127 os.environ['PATH'] = os.path.abspath( | 126 os.environ['PATH'] = os.path.abspath( |
128 os.path.join(os.pardir, os.pardir, os.pardir, os.pardir, 'third_party', | 127 os.path.join(os.pardir, os.pardir, os.pardir, os.pardir, 'third_party', |
129 'gsutil')) + os.pathsep + os.environ['PATH'] | 128 'gsutil')) + os.pathsep + os.environ['PATH'] |
130 os.environ['BOTO_CONFIG'] = os.path.abspath(os.path.join( | 129 os.environ['BOTO_CONFIG'] = os.path.abspath(os.path.join( |
131 os.pardir, os.pardir, os.pardir, os.pardir, 'site_config', '.boto')) | 130 os.pardir, os.pardir, os.pardir, os.pardir, 'site_config', '.boto')) |
132 os.environ['ANDROID_SDK_ROOT'] = self._step.args['android_sdk_root'] | 131 os.environ['ANDROID_SDK_ROOT'] = self._step.args['android_sdk_root'] |
(...skipping 24 matching lines...) Expand all Loading... |
157 os.environ['ANDROID_SDK_ROOT'] = self._step.args['android_sdk_root'] | 156 os.environ['ANDROID_SDK_ROOT'] = self._step.args['android_sdk_root'] |
158 | 157 |
159 def GetDeviceDirs(self): | 158 def GetDeviceDirs(self): |
160 """ Set the directories which will be used by the BuildStep. """ | 159 """ Set the directories which will be used by the BuildStep. """ |
161 if self._serial: | 160 if self._serial: |
162 device_scratch_dir = shell_utils.run( | 161 device_scratch_dir = shell_utils.run( |
163 '%s -s %s shell echo \$EXTERNAL_STORAGE' % ( | 162 '%s -s %s shell echo \$EXTERNAL_STORAGE' % ( |
164 android_utils.PATH_TO_ADB, self._serial), | 163 android_utils.PATH_TO_ADB, self._serial), |
165 echo=True, shell=True).rstrip().split('\n')[-1] | 164 echo=True, shell=True).rstrip().split('\n')[-1] |
166 prefix = posixpath.join(device_scratch_dir, 'skiabot', 'skia_') | 165 prefix = posixpath.join(device_scratch_dir, 'skiabot', 'skia_') |
167 return DeviceDirs(perf_data_dir=prefix + 'perf', | 166 return DeviceDirs( |
168 gm_actual_dir=prefix + 'gm_actual', | 167 perf_data_dir=prefix + 'perf', |
169 gm_expected_dir=prefix + 'gm_expected', | 168 gm_actual_dir=prefix + 'gm_actual', |
170 resource_dir=prefix + 'resources', | 169 gm_expected_dir=prefix + 'gm_expected', |
171 skimage_in_dir=prefix + 'skimage_in', | 170 resource_dir=prefix + 'resources', |
172 skimage_expected_dir=prefix + 'skimage_expected', | 171 skimage_in_dir=prefix + 'skimage_in', |
173 skimage_out_dir=prefix + 'skimage_out', | 172 skimage_expected_dir=prefix + 'skimage_expected', |
174 skp_dir=prefix + 'skp', | 173 skimage_out_dir=prefix + 'skimage_out', |
175 skp_perf_dir=prefix + 'skp_perf', | 174 skp_dir=prefix + 'skp', |
176 skp_out_dir=prefix + 'skp_out', | 175 skp_perf_dir=prefix + 'skp_perf', |
177 tmp_dir=prefix + 'tmp_dir') | 176 playback_actual_images_dir=prefix + 'playback_actual_images', |
| 177 playback_actual_summaries_dir=prefix + 'playback_actual_summaries', |
| 178 playback_expected_summaries_dir=( |
| 179 prefix + 'playback_expected_summaries'), |
| 180 tmp_dir=prefix + 'tmp_dir') |
OLD | NEW |