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

Side by Side Diff: infra/bots/recipe_modules/flavor/android_flavor.py

Issue 2209423002: [recipes] Remove build environment vars from default_env (Closed) Base URL: https://skia.googlesource.com/skia.git@merge_buildbot_spec_fix_coverage
Patch Set: [recipes] Remove build environment vars from default_env Created 4 years, 4 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
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 5
6 # pylint: disable=W0201 6 # pylint: disable=W0201
7 7
8 8
9 import copy 9 import copy
10 import default_flavor 10 import default_flavor
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 self.serial = None 72 self.serial = None
73 self.serial_args = [] 73 self.serial_args = []
74 try: 74 try:
75 path_to_adb = self.m.step( 75 path_to_adb = self.m.step(
76 'which adb', 76 'which adb',
77 cmd=['which', 'adb'], 77 cmd=['which', 'adb'],
78 stdout=self.m.raw_io.output(), 78 stdout=self.m.raw_io.output(),
79 infra_step=True).stdout.rstrip() 79 infra_step=True).stdout.rstrip()
80 except self.m.step.StepFailure: 80 except self.m.step.StepFailure:
81 path_to_adb = self.m.path.join(self._android_sdk_root, 81 path_to_adb = self.m.path.join(self._android_sdk_root,
82 'platform-tools', 'adb') 82 'platform-tools', 'adb')
83 self._adb = _ADBWrapper( 83 self._adb = _ADBWrapper(
84 self.m, path_to_adb, self.serial_args, self) 84 self.m, path_to_adb, self.serial_args, self)
85 self._default_env = {'ANDROID_SDK_ROOT': self._android_sdk_root, 85 self._default_env = {'ANDROID_SDK_ROOT': self._android_sdk_root,
86 'ANDROID_HOME': self._android_sdk_root, 86 'ANDROID_HOME': self._android_sdk_root,
87 'SKIA_ANDROID_VERBOSE_SETUP': 1} 87 'SKIA_ANDROID_VERBOSE_SETUP': 1}
88 88
89 def step(self, name, cmd, env=None, **kwargs): 89 def step(self, name, cmd, env=None, **kwargs):
90 self._adb.maybe_wait_for_device() 90 self._adb.maybe_wait_for_device()
91 args = [ 91 args = [
92 self.android_bin.join('android_run_skia'), 92 self.android_bin.join('android_run_skia'),
93 '--verbose', 93 '--verbose',
94 '--logcat', 94 '--logcat',
95 '-d', self.device, 95 '-d', self.device,
96 ] + self.serial_args + [ 96 ] + self.serial_args + [
97 '-t', self.m.vars.configuration, 97 '-t', self.m.vars.configuration,
98 ] 98 ]
99 env = dict(env or {}) 99 env = dict(env or {})
100 env.update(self._default_env) 100 env.update(self._default_env)
101 101
102 return self.m.run(self.m.step, name=name, cmd=args + cmd, 102 return self.m.run(self.m.step, name=name, cmd=args + cmd,
103 env=env, **kwargs) 103 env=env, **kwargs)
104 104
105 def compile(self, target): 105 def compile(self, target, **kwargs):
106 """Build the given target.""" 106 """Build the given target."""
107 env = dict(self._default_env) 107 env = kwargs.pop('env', {})
108 env.update(dict(self._default_env))
108 ccache = self.m.run.ccache() 109 ccache = self.m.run.ccache()
109 if ccache: 110 if ccache:
110 env['ANDROID_MAKE_CCACHE'] = ccache 111 env['ANDROID_MAKE_CCACHE'] = ccache
111 112
112 cmd = [self.android_bin.join('android_ninja'), target, '-d', self.device] 113 cmd = [self.android_bin.join('android_ninja'), target, '-d', self.device]
113 if 'Clang' in self.m.vars.builder_name: 114 if 'Clang' in self.m.vars.builder_name:
114 cmd.append('--clang') 115 cmd.append('--clang')
115 if 'GCC' in self.m.vars.builder_name: 116 if 'GCC' in self.m.vars.builder_name:
116 cmd.append('--gcc') 117 cmd.append('--gcc')
117 if 'Vulkan' in self.m.vars.builder_name: 118 if 'Vulkan' in self.m.vars.builder_name:
118 cmd.append('--vulkan') 119 cmd.append('--vulkan')
119 self.m.run(self.m.step, 'build %s' % target, cmd=cmd, 120 self.m.run(self.m.step, 'build %s' % target, cmd=cmd,
120 env=env, cwd=self.m.path['checkout']) 121 env=env, cwd=self.m.path['checkout'], **kwargs)
121 122
122 def device_path_join(self, *args): 123 def device_path_join(self, *args):
123 """Like os.path.join(), but for paths on a connected Android device.""" 124 """Like os.path.join(), but for paths on a connected Android device."""
124 return '/'.join(args) 125 return '/'.join(args)
125 126
126 def device_path_exists(self, path): 127 def device_path_exists(self, path):
127 """Like os.path.exists(), but for paths on a connected device.""" 128 """Like os.path.exists(), but for paths on a connected device."""
128 exists_str = 'FILE_EXISTS' 129 exists_str = 'FILE_EXISTS'
129 return exists_str in self._adb( 130 return exists_str in self._adb(
130 name='exists %s' % self.m.path.basename(path), 131 name='exists %s' % self.m.path.basename(path),
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 infra_step=True).stdout.rstrip() 304 infra_step=True).stdout.rstrip()
304 305
305 def remove_file_on_device(self, path, *args, **kwargs): 306 def remove_file_on_device(self, path, *args, **kwargs):
306 """Delete the given file.""" 307 """Delete the given file."""
307 return self._adb(name='rm %s' % self.m.path.basename(path), 308 return self._adb(name='rm %s' % self.m.path.basename(path),
308 serial=self.serial, 309 serial=self.serial,
309 cmd=['shell', 'rm', '-f', path], 310 cmd=['shell', 'rm', '-f', path],
310 infra_step=True, 311 infra_step=True,
311 *args, 312 *args,
312 **kwargs) 313 **kwargs)
OLDNEW
« no previous file with comments | « no previous file | infra/bots/recipe_modules/flavor/api.py » ('j') | infra/bots/recipe_modules/flavor/api.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698