Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: scripts/slave/recipe_modules/chromium/api.py

Issue 24737002: Add Paths as first-class types in configs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 ChromiumApi(recipe_api.RecipeApi): 7 class ChromiumApi(recipe_api.RecipeApi):
8 def get_config_defaults(self): 8 def get_config_defaults(self):
9 return { 9 return {
10 'HOST_PLATFORM': self.m.platform.name, 10 'HOST_PLATFORM': self.m.platform.name,
(...skipping 10 matching lines...) Expand all
21 'BUILD_CONFIG': self.m.properties.get('build_config', 'Release') 21 'BUILD_CONFIG': self.m.properties.get('build_config', 'Release')
22 } 22 }
23 23
24 def compile(self, targets=None, name=None, **kwargs): 24 def compile(self, targets=None, name=None, **kwargs):
25 """Return a compile.py invocation.""" 25 """Return a compile.py invocation."""
26 targets = targets or self.c.compile_py.default_targets.as_jsonish() 26 targets = targets or self.c.compile_py.default_targets.as_jsonish()
27 assert isinstance(targets, (list, tuple)) 27 assert isinstance(targets, (list, tuple))
28 28
29 args = [ 29 args = [
30 '--target', self.c.build_config_fs, 30 '--target', self.c.build_config_fs,
31 '--build-dir', self.m.path.checkout(self.c.build_dir), 31 '--build-dir', self.c.build_dir,
32 '--src-dir', self.m.path.checkout(), 32 '--src-dir', self.m.path.checkout,
agable 2013/09/26 21:46:02 Did you find/replace for all instances of {m.path|
iannucci 2013/09/27 02:08:20 I didn't, just the ones I saw... it actually doesn
agable 2013/09/27 17:48:16 Thanks. I just wanted to make sure we weren't send
33 ] 33 ]
34 if self.c.compile_py.build_tool: 34 if self.c.compile_py.build_tool:
35 args += ['--build-tool', self.c.compile_py.build_tool] 35 args += ['--build-tool', self.c.compile_py.build_tool]
36 if self.c.compile_py.compiler: 36 if self.c.compile_py.compiler:
37 args += ['--compiler', self.c.compile_py.compiler] 37 args += ['--compiler', self.c.compile_py.compiler]
38 if self.m.properties.get('clobber') is not None: 38 if self.m.properties.get('clobber') is not None:
39 args.append('--clobber') 39 args.append('--clobber')
40 args.append('--') 40 args.append('--')
41 args.extend(targets) 41 args.extend(targets)
42 return self.m.python(name or 'compile', 42 return self.m.python(name or 'compile',
43 self.m.path.build('scripts', 'slave', 'compile.py'), 43 self.m.path.build('scripts', 'slave', 'compile.py'),
44 args, abort_on_failure=True, **kwargs) 44 args, abort_on_failure=True, **kwargs)
45 45
46 def runtests(self, test, args=None, xvfb=False, name=None, annotate=None, 46 def runtests(self, test, args=None, xvfb=False, name=None, annotate=None,
47 results_url=None, perf_dashboard_id=None, test_type=None, 47 results_url=None, perf_dashboard_id=None, test_type=None,
48 generate_json_file=False, results_directory=None, 48 generate_json_file=False, results_directory=None,
49 build_number=None, builder_name=None, **kwargs): 49 build_number=None, builder_name=None, **kwargs):
50 """Return a runtest.py invocation.""" 50 """Return a runtest.py invocation."""
51 args = args or [] 51 args = args or []
52 assert isinstance(args, list) 52 assert isinstance(args, list)
53 53
54 t_name, ext = self.m.path.splitext(self.m.path.basename(test)) 54 t_name, ext = self.m.path.splitext(self.m.path.basename(test))
55 if self.m.platform.is_win and ext == '': 55 if self.m.platform.is_win and ext == '':
56 test += '.exe' 56 test += '.exe'
57 57
58 full_args = [ 58 full_args = [
59 '--target', self.c.build_config_fs, 59 '--target', self.c.build_config_fs,
60 '--build-dir', self.m.path.checkout(self.c.build_dir), 60 '--build-dir', self.c.build_dir,
61 ('--xvfb' if xvfb else '--no-xvfb') 61 ('--xvfb' if xvfb else '--no-xvfb')
62 ] 62 ]
63 full_args += self.m.json.property_args() 63 full_args += self.m.json.property_args()
64 64
65 if annotate: 65 if annotate:
66 full_args.append('--annotate=%s' % annotate) 66 full_args.append('--annotate=%s' % annotate)
67 kwargs['allow_subannotations'] = True 67 kwargs['allow_subannotations'] = True
68 if results_url: 68 if results_url:
69 full_args.append('--results-url=%s' % results_url) 69 full_args.append('--results-url=%s' % results_url)
70 if perf_dashboard_id: 70 if perf_dashboard_id:
(...skipping 24 matching lines...) Expand all
95 **kwargs 95 **kwargs
96 ) 96 )
97 97
98 def runhooks(self, **kwargs): 98 def runhooks(self, **kwargs):
99 """Run the build-configuration hooks for chromium.""" 99 """Run the build-configuration hooks for chromium."""
100 env = kwargs.get('env', {}) 100 env = kwargs.get('env', {})
101 env.update(self.c.gyp_env.as_jsonish()) 101 env.update(self.c.gyp_env.as_jsonish())
102 kwargs['env'] = env 102 kwargs['env'] = env
103 return self.m.gclient.runhooks(**kwargs) 103 return self.m.gclient.runhooks(**kwargs)
104 104
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698