| 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 import default_flavor | 5 import default_flavor |
| 6 import subprocess | 6 import subprocess |
| 7 | 7 |
| 8 """GN Android flavor utils, used for building Skia for Android with GN.""" | 8 """GN Android flavor utils, used for building Skia for Android with GN.""" |
| 9 class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils): | 9 class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils): |
| 10 def __init__(self, m): | 10 def __init__(self, m): |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 device = sys.argv[2] | 111 device = sys.argv[2] |
| 112 for d, _, fs in os.walk(host): | 112 for d, _, fs in os.walk(host): |
| 113 p = os.path.relpath(d, host) | 113 p = os.path.relpath(d, host) |
| 114 if p != '.' and p.startswith('.'): | 114 if p != '.' and p.startswith('.'): |
| 115 continue | 115 continue |
| 116 for f in fs: | 116 for f in fs: |
| 117 print os.path.join(p,f) | 117 print os.path.join(p,f) |
| 118 subprocess.check_call(['adb', 'push', | 118 subprocess.check_call(['adb', 'push', |
| 119 os.path.realpath(os.path.join(host, p, f)), | 119 os.path.realpath(os.path.join(host, p, f)), |
| 120 os.path.join(device, p, f)]) | 120 os.path.join(device, p, f)]) |
| 121 """, args=[host, device], cwd=self.m.vars.skia_dir) | 121 """, args=[host, device], cwd=self.m.vars.skia_dir, infra_step=True) |
| 122 | 122 |
| 123 def copy_directory_contents_to_host(self, device, host): | 123 def copy_directory_contents_to_host(self, device, host): |
| 124 self._adb('pull %s %s' % (device, host), 'pull', device, host) | 124 self._adb('pull %s %s' % (device, host), 'pull', device, host) |
| 125 | 125 |
| 126 def read_file_on_device(self, path): | 126 def read_file_on_device(self, path): |
| 127 return self._adb('read %s' % path, | 127 return self._adb('read %s' % path, |
| 128 'shell', 'cat', path, stdout=self.m.raw_io.output()).stdout | 128 'shell', 'cat', path, stdout=self.m.raw_io.output()).stdout |
| 129 | 129 |
| 130 def remove_file_on_device(self, path): | 130 def remove_file_on_device(self, path): |
| 131 self._adb('rm %s' % path, 'shell', 'rm', '-f', path) | 131 self._adb('rm %s' % path, 'shell', 'rm', '-f', path) |
| 132 | 132 |
| 133 def create_clean_device_dir(self, path): | 133 def create_clean_device_dir(self, path): |
| 134 self._adb('rm %s' % path, 'shell', 'rm', '-rf', path) | 134 self._adb('rm %s' % path, 'shell', 'rm', '-rf', path) |
| 135 self._adb('mkdir %s' % path, 'shell', 'mkdir', '-p', path) | 135 self._adb('mkdir %s' % path, 'shell', 'mkdir', '-p', path) |
| OLD | NEW |