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

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

Issue 1923883003: build: use class path bases, not strings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: rebase Created 4 years, 7 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
« no previous file with comments | « infra/config/recipes.cfg ('k') | scripts/slave/recipe_modules/chromium/config.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 import re 5 import re
6 6
7 from recipe_engine import recipe_api 7 from recipe_engine import recipe_api
8 from recipe_engine import util as recipe_util 8 from recipe_engine import util as recipe_util
9 9
10 class TestLauncherFilterFileInputPlaceholder(recipe_util.InputPlaceholder): 10 class TestLauncherFilterFileInputPlaceholder(recipe_util.InputPlaceholder):
(...skipping 10 matching lines...) Expand all
21 def cleanup(self, test_enabled): 21 def cleanup(self, test_enabled):
22 self.raw.cleanup(test_enabled) 22 self.raw.cleanup(test_enabled)
23 23
24 24
25 class ChromiumApi(recipe_api.RecipeApi): 25 class ChromiumApi(recipe_api.RecipeApi):
26 def __init__(self, *args, **kwargs): 26 def __init__(self, *args, **kwargs):
27 super(ChromiumApi, self).__init__(*args, **kwargs) 27 super(ChromiumApi, self).__init__(*args, **kwargs)
28 self._build_properties = None 28 self._build_properties = None
29 29
30 def get_config_defaults(self): 30 def get_config_defaults(self):
31 return { 31 defaults = {
32 'HOST_PLATFORM': self.m.platform.name, 32 'HOST_PLATFORM': self.m.platform.name,
33 'HOST_ARCH': self.m.platform.arch, 33 'HOST_ARCH': self.m.platform.arch,
34 'HOST_BITS': self.m.platform.bits, 34 'HOST_BITS': self.m.platform.bits,
35 35
36 'TARGET_PLATFORM': self.m.platform.name, 36 'TARGET_PLATFORM': self.m.platform.name,
37 'TARGET_ARCH': self.m.platform.arch, 37 'TARGET_ARCH': self.m.platform.arch,
38 'TARGET_CROS_BOARD': None, 38 'TARGET_CROS_BOARD': None,
39 39
40 # NOTE: This is replicating logic which lives in 40 # NOTE: This is replicating logic which lives in
41 # chrome/trunk/src/build/common.gypi, which is undesirable. The desired 41 # chrome/trunk/src/build/common.gypi, which is undesirable. The desired
42 # end-state is that all the configuration logic lives in one place 42 # end-state is that all the configuration logic lives in one place
43 # (in chromium/config.py), and the buildside gypfiles are as dumb as 43 # (in chromium/config.py), and the buildside gypfiles are as dumb as
44 # possible. However, since the recipes need to accurately contain 44 # possible. However, since the recipes need to accurately contain
45 # {TARGET,HOST}_{BITS,ARCH,PLATFORM}, for use across many tools (of which 45 # {TARGET,HOST}_{BITS,ARCH,PLATFORM}, for use across many tools (of which
46 # gyp is one tool), we're taking a small risk and replicating the logic 46 # gyp is one tool), we're taking a small risk and replicating the logic
47 # here. 47 # here.
48 'TARGET_BITS': ( 48 'TARGET_BITS': (
49 32 if self.m.platform.name == 'win' 49 32 if self.m.platform.name == 'win'
50 else self.m.platform.bits), 50 else self.m.platform.bits),
51 51
52 'BUILD_CONFIG': self.m.properties.get('build_config', 'Release'), 52 'BUILD_CONFIG': self.m.properties.get('build_config', 'Release'),
53
54 'CHECKOUT_PATH': self.m.path['checkout'],
53 } 55 }
54 56
57 # Fallback in case build path is not available.
58 # TODO(phajdan.jr): get rid of the need for BUILD_PATH in config.
59 try:
60 defaults['BUILD_PATH'] = self.m.path['build']
61 except KeyError:
62 defaults['BUILD_PATH'] = self.package_repo_resource()
63
64 return defaults
65
55 def get_env(self): 66 def get_env(self):
56 ret = {} 67 ret = {}
57 if self.c.env.PATH: 68 if self.c.env.PATH:
58 ret['PATH'] = self.m.path.pathsep.join( 69 ret['PATH'] = self.m.path.pathsep.join(
59 map(str, self.c.env.PATH) + ['%(PATH)s']) 70 map(str, self.c.env.PATH) + ['%(PATH)s'])
60 if self.c.env.ADB_VENDOR_KEYS: 71 if self.c.env.ADB_VENDOR_KEYS:
61 ret['ADB_VENDOR_KEYS'] = self.c.env.ADB_VENDOR_KEYS 72 ret['ADB_VENDOR_KEYS'] = self.c.env.ADB_VENDOR_KEYS
62 if self.c.env.LLVM_FORCE_HEAD_REVISION: 73 if self.c.env.LLVM_FORCE_HEAD_REVISION:
63 ret['LLVM_FORCE_HEAD_REVISION'] = self.c.env.LLVM_FORCE_HEAD_REVISION 74 ret['LLVM_FORCE_HEAD_REVISION'] = self.c.env.LLVM_FORCE_HEAD_REVISION
64 if self.c.env.GOMA_STUBBY_PROXY_IP_ADDRESS: 75 if self.c.env.GOMA_STUBBY_PROXY_IP_ADDRESS:
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 })) 744 }))
734 745
735 def get_annotate_by_test_name(self, test_name): 746 def get_annotate_by_test_name(self, test_name):
736 return 'graphing' 747 return 'graphing'
737 748
738 def download_lto_plugin(self): 749 def download_lto_plugin(self):
739 return self.m.python( 750 return self.m.python(
740 name='download LTO plugin', 751 name='download LTO plugin',
741 script=self.m.path['checkout'].join( 752 script=self.m.path['checkout'].join(
742 'build', 'download_gold_plugin.py')) 753 'build', 'download_gold_plugin.py'))
OLDNEW
« no previous file with comments | « infra/config/recipes.cfg ('k') | scripts/slave/recipe_modules/chromium/config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698