OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 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. | 5 # BSD-style license that can be found in the LICENSE file. |
6 | 6 |
7 """ | 7 """ |
8 Buildbot steps for src tarball generation and debian package generation | 8 Buildbot steps for src tarball generation and debian package generation |
9 | 9 |
10 Package up the src of the dart repo and create a debian package. | 10 Package up the src of the dart repo and create a debian package. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 if entry.endswith("_amd64.deb"): | 60 if entry.endswith("_amd64.deb"): |
61 path = os.path.join(builddir, entry) | 61 path = os.path.join(builddir, entry) |
62 Run(['sudo', 'dpkg', '-i', path]) | 62 Run(['sudo', 'dpkg', '-i', path]) |
63 | 63 |
64 def UninstallDart(): | 64 def UninstallDart(): |
65 Run(['sudo', 'dpkg', '-r', 'dart']) | 65 Run(['sudo', 'dpkg', '-r', 'dart']) |
66 | 66 |
67 def CreateDartTestFile(tempdir): | 67 def CreateDartTestFile(tempdir): |
68 filename = os.path.join(tempdir, 'test.dart') | 68 filename = os.path.join(tempdir, 'test.dart') |
69 with open(filename, 'w') as f: | 69 with open(filename, 'w') as f: |
70 f.write('import "dart:html";\n\n') | 70 f.write('import "dart:collection";\n\n') |
71 f.write('void main() {\n') | 71 f.write('void main() {\n') |
72 f.write(' print("Hello world");\n') | 72 f.write(' print("Hello world");\n') |
73 f.write('}') | 73 f.write('}') |
74 return filename | 74 return filename |
75 | 75 |
76 def Run(args): | 76 def Run(args): |
77 print "Running: %s" % ' '.join(args) | 77 print "Running: %s" % ' '.join(args) |
78 sys.stdout.flush() | 78 sys.stdout.flush() |
79 bot.RunProcess(args) | 79 bot.RunProcess(args) |
80 | 80 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 InstallFromDep(builddir) | 143 InstallFromDep(builddir) |
144 TestInstallation(assume_installed=True) | 144 TestInstallation(assume_installed=True) |
145 | 145 |
146 # We build the runtime target to get everything we need to test the | 146 # We build the runtime target to get everything we need to test the |
147 # standalone target. | 147 # standalone target. |
148 Run([sys.executable, './tools/build.py', '-mrelease', '-ax64', 'runtime']) | 148 Run([sys.executable, './tools/build.py', '-mrelease', '-ax64', 'runtime']) |
149 # Copy in the installed binary to avoid poluting /usr/bin (and having to | 149 # Copy in the installed binary to avoid poluting /usr/bin (and having to |
150 # run as root) | 150 # run as root) |
151 Run(['cp', '/usr/bin/dart', 'out/ReleaseX64/dart']) | 151 Run(['cp', '/usr/bin/dart', 'out/ReleaseX64/dart']) |
152 | 152 |
153 Run([sys.executable, './tools/test.py', '-ax64', | 153 # We currently can't run the testing script on wheezy since the checked in |
154 '--mode=release', 'standalone']) | 154 # binary is built on precise, see issue 18742 |
155 if (build_info.builder_tag == 'ubuntu_precise'): | |
Søren Gjesse
2014/05/09 08:42:06
Could a temporary hack be to copy the newly built
ricow1
2014/05/09 09:08:47
We should just put in the wheezy binary, how about
| |
156 Run([sys.executable, './tools/test.py', '-ax64', | |
157 '--mode=release', 'standalone']) | |
155 | 158 |
156 # Sanity check dart2js and the analyzer against a hello world program | 159 # Sanity check dart2js and the analyzer against a hello world program |
157 with utils.TempDir() as temp_dir: | 160 with utils.TempDir() as temp_dir: |
158 test_file = CreateDartTestFile(temp_dir) | 161 test_file = CreateDartTestFile(temp_dir) |
159 Run(['/usr/lib/dart/bin/dart2js', test_file]) | 162 Run(['/usr/lib/dart/bin/dart2js', test_file]) |
160 Run(['/usr/lib/dart/bin/dartanalyzer', test_file]) | 163 Run(['/usr/lib/dart/bin/dartanalyzer', test_file]) |
164 Run(['/usr/lib/dart/bin/dart', test_file]) | |
161 | 165 |
162 # Sanity check that pub can start up and print the version | 166 # Sanity check that pub can start up and print the version |
163 Run(['/usr/lib/dart/bin/pub', '--version']) | 167 Run(['/usr/lib/dart/bin/pub', '--version']) |
164 | 168 |
165 UninstallDart() | 169 UninstallDart() |
166 TestInstallation(assume_installed=False) | 170 TestInstallation(assume_installed=False) |
167 | 171 |
168 with bot.BuildStep('Upload artifacts'): | 172 with bot.BuildStep('Upload artifacts'): |
169 bot_name, _ = bot.GetBotName() | 173 bot_name, _ = bot.GetBotName() |
170 channel = bot_utils.GetChannelFromName(bot_name) | 174 channel = bot_utils.GetChannelFromName(bot_name) |
171 if channel != bot_utils.Channel.BLEEDING_EDGE: | 175 if channel != bot_utils.Channel.BLEEDING_EDGE: |
172 ArchiveArtifacts(tarfile, builddir, channel, build_info.builder_tag) | 176 ArchiveArtifacts(tarfile, builddir, channel, build_info.builder_tag) |
173 else: | 177 else: |
174 print 'Not uploading artifacts on bleeding edge' | 178 print 'Not uploading artifacts on bleeding edge' |
175 | 179 |
176 if __name__ == '__main__': | 180 if __name__ == '__main__': |
177 # We pass in None for build_step to avoid building the sdk. | 181 # We pass in None for build_step to avoid building the sdk. |
178 bot.RunBot(SrcConfig, SrcSteps, build_step=None) | 182 bot.RunBot(SrcConfig, SrcSteps, build_step=None) |
OLD | NEW |