OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import copy | 9 import copy |
10 import default_flavor | 10 import default_flavor |
(...skipping 17 matching lines...) Expand all Loading... |
28 env.update(kwargs.pop('env', {})) | 28 env.update(kwargs.pop('env', {})) |
29 env.update(self.default_env) | 29 env.update(self.default_env) |
30 # Convert 'dm' and 'nanobench' from positional arguments | 30 # Convert 'dm' and 'nanobench' from positional arguments |
31 # to flags, which is what iOSShell expects to select which | 31 # to flags, which is what iOSShell expects to select which |
32 # one is being run. | 32 # one is being run. |
33 cmd = ["--" + c if c in ['dm', 'nanobench'] else c | 33 cmd = ["--" + c if c in ['dm', 'nanobench'] else c |
34 for c in cmd] | 34 for c in cmd] |
35 return self.m.run(self.m.step, name=name, cmd=args + cmd, | 35 return self.m.run(self.m.step, name=name, cmd=args + cmd, |
36 env=env, **kwargs) | 36 env=env, **kwargs) |
37 | 37 |
38 def compile(self, target): | 38 def compile(self, target, **kwargs): |
39 """Build the given target.""" | 39 """Build the given target.""" |
40 cmd = [self.ios_bin.join('ios_ninja')] | 40 cmd = [self.ios_bin.join('ios_ninja')] |
41 self.m.run(self.m.step, 'build iOSShell', cmd=cmd, | 41 self.m.run(self.m.step, 'build iOSShell', cmd=cmd, |
42 cwd=self.m.path['checkout']) | 42 cwd=self.m.path['checkout'], **kwargs) |
43 | 43 |
44 def device_path_join(self, *args): | 44 def device_path_join(self, *args): |
45 """Like os.path.join(), but for paths on a connected iOS device.""" | 45 """Like os.path.join(), but for paths on a connected iOS device.""" |
46 return '/'.join(args) | 46 return '/'.join(args) |
47 | 47 |
48 def device_path_exists(self, path): | 48 def device_path_exists(self, path): |
49 """Like os.path.exists(), but for paths on a connected device.""" | 49 """Like os.path.exists(), but for paths on a connected device.""" |
50 return self.m.run( | 50 return self.m.run( |
51 self.m.step, | 51 self.m.step, |
52 'exists %s' % path, | 52 'exists %s' % path, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 def remove_file_on_device(self, path): | 168 def remove_file_on_device(self, path): |
169 """Remove the file on the device.""" | 169 """Remove the file on the device.""" |
170 return self.m.run( | 170 return self.m.run( |
171 self.m.step, | 171 self.m.step, |
172 'rm %s' % path, | 172 'rm %s' % path, |
173 cmd=[self.ios_bin.join('ios_rm'), path], | 173 cmd=[self.ios_bin.join('ios_rm'), path], |
174 env=self.default_env, | 174 env=self.default_env, |
175 infra_step=True, | 175 infra_step=True, |
176 ) | 176 ) |
OLD | NEW |