19 """Prepare the variables."""
20
21
22
23 if self.m.path.basename(self.m.path.start_dir) == 'k':
24 self.m.path._start_dir = self.m.path._start_dir[:-2]
25
26
27 self.builder_name = self.m.properties['buildername']
28
29 self.workdir = self.m.path.start_dir
30
31
32 self.build_dir = self.workdir.
join(
'build')
33
34 self.default_env = self.m.context.env
35 self.default_env['CHROME_HEADLESS'] = '1'
36 self.default_env['PATH'] = self.m.path.pathsep.join([
37 self.default_env.
get(
'PATH',
'%(PATH)s'),
38 str(self.m.bot_update.repo_resource()),
39 ])
40 self.cache_dir = self.workdir.
join(
'cache')
41
42 self.swarming_out_dir = self.workdir.
join(
43 self.m.properties.get('swarm_out_dir', 'tmp'))
44
45 self.tmp_dir = self.m.path.start_dir.join('tmp')
46
47 self.builder_cfg = self.m.builder_name_schema.DictForBuilderName(
48 self.builder_name)
49 self.role = self.builder_cfg['role']
50 if self.role == self.m.builder_name_schema.BUILDER_ROLE_HOUSEKEEPER:
51 self.configuration = CONFIG_RELEASE
52 else:
53 self.configuration = self.builder_cfg.
get(
'configuration', CONFIG_DEBUG)
54 arch = (self.builder_cfg.
get(
'arch')
or self.builder_cfg.
get(
'target_arch'))
55 if (
'Win' in self.builder_cfg.
get(
'os',
'')
and arch ==
'x86_64'):
56 self.configuration += '_x64'
57
58 self.extra_tokens = []
59 if len(self.builder_cfg.
get(
'extra_config',
'')) > 0:
60 if self.builder_cfg['extra_config'].startswith('SK'):
61 assert self.builder_cfg['extra_config'].isupper()
62 self.extra_tokens = [self.builder_cfg['extra_config']]
63 else:
64 self.extra_tokens = self.builder_cfg['extra_config'].split('_')
65
66 self.patch_storage = self.m.properties.get('patch_storage', 'gerrit')
67 self.issue = None
68 self.patchset = None
69 self.is_trybot = False
70 if (self.m.properties.get('patch_issue', '') and
71 self.m.properties['patch_issue'] != '0' and
72 self.m.properties.get('patch_set', '') and
73 self.m.properties['patch_set'] != '0' and
74 self.m.properties.get('patch_ref', '')):
75 self.is_trybot = True
76 self.issue = self.m.properties['patch_issue']
77 self.patchset = self.m.properties['patch_set']
78
79 self._swarming_bot_id = None
80 self._swarming_task_id = None
81
82
83 self.internal_hardware_label = (
84 self.m.properties.get('internal_hardware_label'))
85 self.is_internal_bot = self.internal_hardware_label is not None
86
const myers::Point & get(const myers::Segment &)
static SkString join(const CommandLineFlags::StringArray &)
static void setup(SkCanvas *canvas, SkPaint *paint, const SkBitmap &bm, SkFilterMode fm, SkTileMode tmx, SkTileMode tmy)