| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2013 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2013 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import os | 6 import os |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 from buildbot_lib import ( | 9 from buildbot_lib import ( |
| 10 BuildContext, BuildStatus, Command, ParseStandardCommandLine, | 10 BuildContext, BuildStatus, Command, ParseStandardCommandLine, |
| 11 RemoveSconsBuildDirectories, RunBuild, SetupLinuxEnvironment, | 11 RemoveSconsBuildDirectories, RunBuild, SetupLinuxEnvironment, |
| 12 SetupMacEnvironment, SetupWindowsEnvironment, SCons, Step ) | 12 SetupWindowsEnvironment, SCons, Step ) |
| 13 | 13 |
| 14 sys.path.append(os.path.join(os.path.dirname(__file__), '..')) | 14 sys.path.append(os.path.join(os.path.dirname(__file__), '..')) |
| 15 import pynacl.platform | 15 import pynacl.platform |
| 16 | 16 |
| 17 def RunSconsTests(status, context): | 17 def RunSconsTests(status, context): |
| 18 # Clean out build directories, unless we have built elsewhere. | 18 # Clean out build directories, unless we have built elsewhere. |
| 19 if not context['skip_build']: | 19 if not context['skip_build']: |
| 20 with Step('clobber scons', status): | 20 with Step('clobber scons', status): |
| 21 RemoveSconsBuildDirectories() | 21 RemoveSconsBuildDirectories() |
| 22 | 22 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 def Main(): | 207 def Main(): |
| 208 context = BuildContext() | 208 context = BuildContext() |
| 209 status = BuildStatus(context) | 209 status = BuildStatus(context) |
| 210 ParseStandardCommandLine(context) | 210 ParseStandardCommandLine(context) |
| 211 | 211 |
| 212 if context.Linux(): | 212 if context.Linux(): |
| 213 SetupLinuxEnvironment(context) | 213 SetupLinuxEnvironment(context) |
| 214 elif context.Windows(): | 214 elif context.Windows(): |
| 215 SetupWindowsEnvironment(context) | 215 SetupWindowsEnvironment(context) |
| 216 elif context.Mac(): | 216 elif context.Mac(): |
| 217 SetupMacEnvironment(context) | 217 # No setup to do for Mac. |
| 218 pass |
| 218 else: | 219 else: |
| 219 raise Exception('Unsupported platform') | 220 raise Exception('Unsupported platform') |
| 220 | 221 |
| 221 # Panda bots only have 2 cores. | 222 # Panda bots only have 2 cores. |
| 222 if pynacl.platform.GetArch() == 'arm': | 223 if pynacl.platform.GetArch() == 'arm': |
| 223 context['max_jobs'] = 2 | 224 context['max_jobs'] = 2 |
| 224 | 225 |
| 225 RunBuild(RunSconsTests, status) | 226 RunBuild(RunSconsTests, status) |
| 226 | 227 |
| 227 if __name__ == '__main__': | 228 if __name__ == '__main__': |
| 228 Main() | 229 Main() |
| OLD | NEW |