Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Set of utilities to add commands to a buildbot factory (BuildFactory). | 5 """Set of utilities to add commands to a buildbot factory (BuildFactory). |
| 6 | 6 |
| 7 All the utility functions to add steps to a build factory here are not | 7 All the utility functions to add steps to a build factory here are not |
| 8 project-specific. See the other *_commands.py for project-specific commands. | 8 project-specific. See the other *_commands.py for project-specific commands. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1041 """Adds a step to the factory to run the gclient hooks.""" | 1041 """Adds a step to the factory to run the gclient hooks.""" |
| 1042 env = env or {} | 1042 env = env or {} |
| 1043 env['LANDMINES_VERBOSE'] = '1' | 1043 env['LANDMINES_VERBOSE'] = '1' |
| 1044 env['DEPOT_TOOLS_UPDATE'] = '0' | 1044 env['DEPOT_TOOLS_UPDATE'] = '0' |
| 1045 env['CHROMIUM_GYP_SYNTAX_CHECK'] = '1' | 1045 env['CHROMIUM_GYP_SYNTAX_CHECK'] = '1' |
| 1046 if timeout is None: | 1046 if timeout is None: |
| 1047 timeout = 60*10 | 1047 timeout = 60*10 |
| 1048 cmd = [self._python, self._runhooks_tool] | 1048 cmd = [self._python, self._runhooks_tool] |
| 1049 | 1049 |
| 1050 options = options or {} | 1050 options = options or {} |
| 1051 if '--compiler=goma' in options or '--compiler=goma-clang' in options: | |
| 1052 cmd.append('--use-goma') | |
| 1053 | |
| 1054 self._factory.addStep( | 1051 self._factory.addStep( |
| 1055 shell.ShellCommand, | 1052 shell.ShellCommand, |
| 1056 haltOnFailure=True, | 1053 haltOnFailure=True, |
| 1057 name='runhooks', | 1054 name='runhooks', |
| 1058 description='gclient hooks', | 1055 description='gclient hooks', |
| 1059 env=env, | 1056 env=env, |
| 1060 locks=[self.slave_exclusive_lock], | 1057 locks=[self.slave_exclusive_lock], |
| 1061 timeout=timeout, | 1058 timeout=timeout, |
| 1062 command=cmd) | 1059 command=cmd) |
| 1063 | 1060 |
| 1064 def AddGenerateBuildFilesStep(self, env=None, timeout=None, options=None, | 1061 def AddGenerateBuildFilesStep(self, env=None, timeout=None, options=None, |
| 1065 config_file_path=None, target=None): | 1062 config_file_path=None, target=None): |
| 1063 options = options or [] | |
| 1066 if not config_file_path: | 1064 if not config_file_path: |
| 1067 config_file_path = self.PathJoin(self._repository_root, | 1065 config_file_path = self.PathJoin(self._repository_root, |
| 1068 'tools', 'mb', 'mb_config.pyl') | 1066 'tools', 'mb', 'mb_config.pyl') |
| 1067 | |
| 1069 cmd = [self._python, self._mb_tool, 'gen', | 1068 cmd = [self._python, self._mb_tool, 'gen', |
| 1070 '-m', WithProperties('%(mastername)s'), | 1069 '-m', WithProperties('%(mastername)s'), |
| 1071 '-b', WithProperties('%(buildername)s'), | 1070 '-b', WithProperties('%(buildername)s'), |
| 1072 '--config-file', config_file_path, | 1071 '--config-file', config_file_path] |
| 1073 '//out/%s' % target] | 1072 |
| 1073 if '--compiler=goma' in options or '--compiler=goma-clang' in options: | |
| 1074 cmd += ['--goma-dir', self.PathJoin('..', '..', '..', '..', 'goma')] | |
|
nodir
2016/04/23 00:43:38
ugh
| |
| 1075 | |
| 1076 cmd += ['//out/%s' % target] | |
| 1074 | 1077 |
| 1075 self._factory.addStep( | 1078 self._factory.addStep( |
| 1076 shell.ShellCommand, | 1079 shell.ShellCommand, |
| 1077 haltOnFailure=True, | 1080 haltOnFailure=True, |
| 1078 name='generate_build_files', | 1081 name='generate_build_files', |
| 1079 description='generate build files', | 1082 description='generate build files', |
| 1080 env=env, | 1083 env=env, |
| 1081 locks=[self.slave_exclusive_lock], | 1084 locks=[self.slave_exclusive_lock], |
| 1082 timeout=timeout, | 1085 timeout=timeout, |
| 1083 command=cmd) | 1086 command=cmd) |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1369 | 1372 |
| 1370 def commandComplete(self, cmd): | 1373 def commandComplete(self, cmd): |
| 1371 out = cmd.logs['stdio'].getText() | 1374 out = cmd.logs['stdio'].getText() |
| 1372 build_properties = re.findall('BUILD_PROPERTY ([^=]*)=(.*)', out) | 1375 build_properties = re.findall('BUILD_PROPERTY ([^=]*)=(.*)', out) |
| 1373 for propname, value in build_properties: | 1376 for propname, value in build_properties: |
| 1374 # findall can return strings containing CR characters, remove with strip. | 1377 # findall can return strings containing CR characters, remove with strip. |
| 1375 self.build.setProperty(propname, value.strip(), 'Step') | 1378 self.build.setProperty(propname, value.strip(), 'Step') |
| 1376 | 1379 |
| 1377 def getText(self, cmd, results): | 1380 def getText(self, cmd, results): |
| 1378 return self.describe(True) + self.messages | 1381 return self.describe(True) + self.messages |
| OLD | NEW |