OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/python | |
2 | |
ricow1
2013/03/21 15:13:05
remove blank line
kustermann
2013/03/21 15:24:48
Done.
| |
3 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
4 # for details. All rights reserved. Use of this source code is governed by a | |
5 # BSD-style license that can be found in the LICENSE file. | |
6 | |
7 import os | |
8 import sys | |
9 | |
10 import bot | |
11 | |
12 def GetEditorExecutable(mode, arch): | |
13 configuration_dir = mode + arch.upper() | |
14 linux_path = os.path.join('out', configuration_dir, 'editor') | |
ricow1
2013/03/21 15:13:05
I am fine with us experimenting with this in this
kustermann
2013/03/21 15:24:48
I know, it should be
* ./tools/build.py -mrelease
| |
15 win_path = os.path.join('build', configuration_dir, 'editor') | |
16 mac_path = os.path.join('xcodebuild', configuration_dir, 'editor') | |
17 | |
18 if sys.platform == 'darwin': | |
19 executable = os.path.join('DartEditor.app', 'Contents', 'MacOS', | |
20 'DartEditor') | |
21 # TODO(kustermann,ricow): Maybe we're able to get rid of this in the future. | |
22 # We use ninja on bots which use out/ instead of xcodebuild/ | |
23 if os.path.exists(linux_path) and os.path.isdir(linux_path): | |
24 return os.path.join(mac_path, executable) | |
25 else: | |
26 return os.path.join(mac_path, executable) | |
ricow1
2013/03/21 15:13:05
we do the same thing in both the if and the else
kustermann
2013/03/21 15:24:48
Thanks for catching this.
| |
27 elif sys.platform == 'win32': | |
28 return os.path.join(win_path, 'DartEditor.exe') | |
29 elif sys.platform == 'linux2': | |
30 return os.path.join(linux_path, 'DartEditor') | |
31 else: | |
32 raise Exception('Unknown platform %s' % sys.platform) | |
33 | |
34 | |
35 def main(): | |
36 build_py = os.path.join('tools', 'build.py') | |
37 architectures = ['ia32', 'x64'] | |
38 test_architectures = ['x64'] | |
39 | |
40 for arch in architectures: | |
41 with bot.BuildStep('Build Editor %s' % arch): | |
42 args = [sys.executable, build_py, | |
43 '-mrelease', '--arch=%s' % arch, 'editor'] | |
44 print 'Running: %s' % (' '.join(args)) | |
45 sys.stdout.flush() | |
46 bot.RunProcess(args) | |
47 | |
48 for arch in test_architectures: | |
49 editor_executable = GetEditorExecutable('Release', arch) | |
50 with bot.BuildStep('Test Editor %s' % arch): | |
51 args = [editor_executable, '--test', '--auto-exit'] | |
52 print 'Running: %s' % (' '.join(args)) | |
53 sys.stdout.flush() | |
54 bot.RunProcess(args) | |
55 return 0 | |
56 | |
57 if __name__ == '__main__': | |
58 try: | |
59 sys.exit(main()) | |
60 except OSError as e: | |
61 sys.exit(e.errno) | |
OLD | NEW |