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 from slave import recipe_api | 5 from slave import recipe_api |
6 | 6 |
7 class AndroidApi(recipe_api.RecipeApi): | 7 class AndroidApi(recipe_api.RecipeApi): |
8 def __init__(self, **kwargs): | 8 def __init__(self, **kwargs): |
9 super(AndroidApi, self).__init__(**kwargs) | 9 super(AndroidApi, self).__init__(**kwargs) |
10 self._env = dict() | 10 self._env = dict() |
11 self._build_internal_android = None | 11 self._build_internal_android = None |
12 self._internal_dir = None | 12 self._internal_dir = None |
13 | 13 |
14 def get_env(self): | 14 def get_env(self): |
agable
2013/09/23 22:57:58
Looks like this snuck in from the rest of your and
| |
15 env_dict = dict(self._env) | 15 env_dict = dict(self._env) |
16 for env_var, value in self.c.extra_env.iteritems(): | 16 for env_var, value in self.c.extra_env.iteritems(): |
17 if isinstance(value, list): | 17 if isinstance(value, list): |
18 env_dict[env_var] = self.m.path.checkout(*value) | 18 env_dict[env_var] = self.m.path.checkout(*value) |
19 else: | 19 else: |
20 env_dict[env_var] = value | 20 env_dict[env_var] = value |
21 # TODO(sivachandra): Use os.pathsep equivalent instead of ':' when it | 21 # TODO(sivachandra): Use os.pathsep equivalent instead of ':' when it |
22 # provided by one of the recipe modules. | 22 # provided by one of the recipe modules. |
23 env_dict['PATH'] = (self._build_internal_android + ':' + | 23 env_dict['PATH'] = (self._build_internal_android + ':' + |
24 self._env.get('PATH', '')) | 24 self._env.get('PATH', '')) |
(...skipping 17 matching lines...) Expand all Loading... | |
42 REPO_URL=repo_url, | 42 REPO_URL=repo_url, |
43 BUILD_CONFIG=target) | 43 BUILD_CONFIG=target) |
44 | 44 |
45 # TODO(sivachandra): Move the setting of the gclient spec below to an | 45 # TODO(sivachandra): Move the setting of the gclient spec below to an |
46 # internal config extension when they are supported by the recipe system. | 46 # internal config extension when they are supported by the recipe system. |
47 spec = self.m.gclient.make_config('android_bare') | 47 spec = self.m.gclient.make_config('android_bare') |
48 spec.target_os = ['android'] | 48 spec.target_os = ['android'] |
49 s = spec.solutions[0] | 49 s = spec.solutions[0] |
50 s.name = repo_name | 50 s.name = repo_name |
51 s.url = repo_url | 51 s.url = repo_url |
52 s.custom_vars = self.c.custom_vars | |
53 s.custom_deps = gclient_custom_deps or {} | 52 s.custom_deps = gclient_custom_deps or {} |
54 if revision: | 53 if revision: |
55 s.revision = revision | 54 s.revision = revision |
56 else: | 55 else: |
57 s.revision = 'refs/remotes/origin/master' | 56 s.revision = 'refs/remotes/origin/master' |
58 | 57 |
59 yield self.m.gclient.checkout(spec) | 58 yield self.m.gclient.checkout(spec) |
60 | 59 |
61 # TODO(sivachandra): Manufacture gclient spec such that it contains "src" | 60 # TODO(sivachandra): Manufacture gclient spec such that it contains "src" |
62 # solution + repo_name solution. Then checkout will be automatically | 61 # solution + repo_name solution. Then checkout will be automatically |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 | 124 |
126 def run_tree_truth(self, show_revisions=False): | 125 def run_tree_truth(self, show_revisions=False): |
127 # TODO(sivachandra): The downstream ToT builder will require | 126 # TODO(sivachandra): The downstream ToT builder will require |
128 # 'Show Revisions' step. | 127 # 'Show Revisions' step. |
129 repos = ['src', 'src-internal'] | 128 repos = ['src', 'src-internal'] |
130 if self.c.REPO_NAME not in repos: | 129 if self.c.REPO_NAME not in repos: |
131 repos.append(self.c.REPO_NAME) | 130 repos.append(self.c.REPO_NAME) |
132 # TODO(sivachandra): Disable subannottations after cleaning up | 131 # TODO(sivachandra): Disable subannottations after cleaning up |
133 # tree_truth.sh. | 132 # tree_truth.sh. |
134 yield self.m.step('tree truth steps', | 133 yield self.m.step('tree truth steps', |
135 [self.m.path.checkout('build', 'tree_truth.sh'), | 134 [self.m.path.checkout('build', 'tree_truth.sh'), |
136 self.m.path.checkout()] + repos, | 135 self.m.path.checkout()] + repos, |
137 allow_subannottations=True) | 136 allow_subannottations=True) |
138 | 137 |
139 def runhooks(self): | 138 def runhooks(self): |
140 run_hooks_env = self.get_env() | 139 run_hooks_env = self.get_env() |
141 if self.m.properties.get('internal'): | 140 if self.m.properties.get('internal'): |
142 run_hooks_env['EXTRA_LANDMINES_SCRIPT'] = self.m.path.checkout( | 141 run_hooks_env['EXTRA_LANDMINES_SCRIPT'] = self.m.path.checkout( |
143 self._internal_dir, 'build', 'get_internal_landmines.py') | 142 self._internal_dir, 'build', 'get_internal_landmines.py') |
144 return self.m.chromium.runhooks(env=run_hooks_env) | 143 return self.m.chromium.runhooks(env=run_hooks_env) |
145 | 144 |
(...skipping 15 matching lines...) Expand all Loading... | |
161 [self.m.path.checkout('tools', 'checkdeps', 'checkdeps.py'), | 160 [self.m.path.checkout('tools', 'checkdeps', 'checkdeps.py'), |
162 '--root=%s' % self._internal_dir], | 161 '--root=%s' % self._internal_dir], |
163 env=self.get_env()) | 162 env=self.get_env()) |
164 | 163 |
165 def lint(self): | 164 def lint(self): |
166 if self.c.INTERNAL: | 165 if self.c.INTERNAL: |
167 return self.m.step( | 166 return self.m.step( |
168 'lint', | 167 'lint', |
169 [self.m.path.checkout(self._internal_dir, 'bin', 'lint.py')], | 168 [self.m.path.checkout(self._internal_dir, 'bin', 'lint.py')], |
170 env=self.get_env()) | 169 env=self.get_env()) |
OLD | NEW |