OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 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 """Common steps for recipes that sync/build Android sources.""" | 5 """Common steps for recipes that sync/build Android sources.""" |
6 | 6 |
7 from slave import recipe_api | 7 from slave import recipe_api |
8 | 8 |
9 class AOSPApi(recipe_api.RecipeApi): | 9 class AOSPApi(recipe_api.RecipeApi): |
10 def __init__(self, **kwargs): | 10 def __init__(self, **kwargs): |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 # The version of repo checked into depot_tools doesn't support switching | 54 # The version of repo checked into depot_tools doesn't support switching |
55 # between branches correctly due to | 55 # between branches correctly due to |
56 # https://code.google.com/p/git-repo/issues/detail?id=46 which is why we use | 56 # https://code.google.com/p/git-repo/issues/detail?id=46 which is why we use |
57 # the copy of repo from the Android tree. | 57 # the copy of repo from the Android tree. |
58 # The copy of repo from depot_tools is only used to bootstrap the Android | 58 # The copy of repo from depot_tools is only used to bootstrap the Android |
59 # tree checkout. | 59 # tree checkout. |
60 repo_in_android_path = self.c.build_path.join('.repo', 'repo', 'repo') | 60 repo_in_android_path = self.c.build_path.join('.repo', 'repo', 'repo') |
61 repo_copy_dir = self.m.path['slave_build'].join('repo_copy') | 61 repo_copy_dir = self.m.path['slave_build'].join('repo_copy') |
62 repo_copy_path = self.m.path['slave_build'].join('repo_copy', 'repo') | 62 repo_copy_path = self.m.path['slave_build'].join('repo_copy', 'repo') |
63 if self.m.path.exists(repo_in_android_path): | 63 if self.m.path.exists(repo_in_android_path): |
64 self.m.path.makedirs('repo copy dir', repo_copy_dir) | 64 self.m.file.makedirs('repo copy dir', repo_copy_dir) |
65 self.m.step('copy repo from Android', [ | 65 self.m.step('copy repo from Android', [ |
66 'cp', repo_in_android_path, repo_copy_path]) | 66 'cp', repo_in_android_path, repo_copy_path]) |
67 self.m.repo.repo_path = repo_copy_path | 67 self.m.repo.repo_path = repo_copy_path |
68 self.m.path.makedirs('android source root', self.c.build_path) | 68 self.m.file.makedirs('android source root', self.c.build_path) |
69 self.m.repo.init(self.c.repo.url, '-b', self.c.repo.branch, | 69 self.m.repo.init(self.c.repo.url, '-b', self.c.repo.branch, |
70 cwd=self.c.build_path) | 70 cwd=self.c.build_path) |
71 self.m.path.mock_add_paths(repo_in_android_path) | 71 self.m.path.mock_add_paths(repo_in_android_path) |
72 | 72 |
73 def repo_sync_steps(self): | 73 def repo_sync_steps(self): |
74 # repo_init_steps must have been invoked first. | 74 # repo_init_steps must have been invoked first. |
75 sync_flags = self.c.repo.sync_flags.as_jsonish() | 75 sync_flags = self.c.repo.sync_flags.as_jsonish() |
76 if self.c.sync_manifest_override: | 76 if self.c.sync_manifest_override: |
77 sync_flags.extend(['-m', self.c.sync_manifest_override]) | 77 sync_flags.extend(['-m', self.c.sync_manifest_override]) |
78 | 78 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 cwd=self.m.path['slave_build'], | 176 cwd=self.m.path['slave_build'], |
177 env=env) | 177 env=env) |
178 | 178 |
179 def update_defaut_props_step(self, extra_properties): | 179 def update_defaut_props_step(self, extra_properties): |
180 update_default_props_command = ( | 180 update_default_props_command = ( |
181 [self.resource('update_default_props.py')] + | 181 [self.resource('update_default_props.py')] + |
182 ['%s=%s' % (k,v) for k,v in extra_properties.iteritems()]) | 182 ['%s=%s' % (k,v) for k,v in extra_properties.iteritems()]) |
183 self.m.step('update /root/default.prop', | 183 self.m.step('update /root/default.prop', |
184 self.with_lunch_command + update_default_props_command) | 184 self.with_lunch_command + update_default_props_command) |
185 | 185 |
OLD | NEW |