| OLD | NEW |
| 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
| 3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #!/usr/bin/python | 5 #!/usr/bin/python |
| 6 | 6 |
| 7 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 7 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 8 # Use of this source code is governed by a BSD-style license that can be | 8 # Use of this source code is governed by a BSD-style license that can be |
| 9 # found in the LICENSE file. | 9 # found in the LICENSE file. |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 if pattern: | 57 if pattern: |
| 58 platform = pattern.group(1) | 58 platform = pattern.group(1) |
| 59 component = pattern.group(2) | 59 component = pattern.group(2) |
| 60 mode = pattern.group(3) | 60 mode = pattern.group(3) |
| 61 | 61 |
| 62 # Fall back if not on builder. | 62 # Fall back if not on builder. |
| 63 if not name: | 63 if not name: |
| 64 name = socket.gethostname().split('.')[0] | 64 name = socket.gethostname().split('.')[0] |
| 65 if not version: | 65 if not version: |
| 66 pipe = subprocess.Popen( | 66 pipe = subprocess.Popen( |
| 67 ['svnversion', '-n'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | 67 ['svnversion', '-n'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, |
| 68 shell=True) |
| 68 output = pipe.communicate() | 69 output = pipe.communicate() |
| 69 if pipe.returncode == 0: | 70 if pipe.returncode == 0: |
| 70 version = output[0] | 71 version = output[0] |
| 71 else: | 72 else: |
| 72 version = 'unknown' | 73 version = 'unknown' |
| 73 return (name, version, component, mode, platform) | 74 return (name, version, component, mode, platform) |
| 74 | 75 |
| 75 | 76 |
| 76 def RunDartcCompiler(mode, outdir): | 77 def RunDartcCompiler(mode, outdir): |
| 77 """Compiles the client code to javascript for dartc tests.""" | 78 """Compiles the client code to javascript for dartc tests.""" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 '--name=' + name, '--out=' + outdir] | 168 '--name=' + name, '--out=' + outdir] |
| 168 local_env = os.environ | 169 local_env = os.environ |
| 169 if 'linux' in name: | 170 if 'linux' in name: |
| 170 javahome = os.path.join(os.path.expanduser('~'), 'jdk1.6.0_25') | 171 javahome = os.path.join(os.path.expanduser('~'), 'jdk1.6.0_25') |
| 171 local_env['JAVA_HOME'] = javahome | 172 local_env['JAVA_HOME'] = javahome |
| 172 local_env['PATH'] = (os.path.join(javahome, 'bin') + | 173 local_env['PATH'] = (os.path.join(javahome, 'bin') + |
| 173 os.pathsep + local_env['PATH']) | 174 os.pathsep + local_env['PATH']) |
| 174 | 175 |
| 175 return subprocess.call(cmds, env=local_env) | 176 return subprocess.call(cmds, env=local_env) |
| 176 | 177 |
| 177 def ProcessFrog(): | 178 def ProcessFrog(name): |
| 178 ''' | 179 ''' |
| 179 build and test experimental frog build | 180 build and test experimental frog build |
| 180 ''' | 181 ''' |
| 181 print 'ProcessFrog' | 182 print 'ProcessFrog' |
| 183 if 'windows' in name: |
| 184 os.environ['PATH'] = (os.path.join('C:', 'Program Files (x86)', 'nodejs') + |
| 185 os.pathsep + os.environ['PATH']) |
| 182 | 186 |
| 183 return subprocess.call([sys.executable, | 187 return subprocess.call([sys.executable, |
| 184 os.path.join('frog', 'scripts', 'buildbot_annotated_steps.py')]) | 188 os.path.join('frog', 'scripts', 'buildbot_annotated_steps.py')], |
| 189 env=os.environ, shell=True) |
| 185 | 190 |
| 186 def main(): | 191 def main(): |
| 187 print 'main' | 192 print 'main' |
| 188 if len(sys.argv) == 0: | 193 if len(sys.argv) == 0: |
| 189 print 'Script pathname not known, giving up.' | 194 print 'Script pathname not known, giving up.' |
| 190 return 1 | 195 return 1 |
| 191 | 196 |
| 192 scriptdir = os.path.dirname(sys.argv[0]) | 197 scriptdir = os.path.dirname(sys.argv[0]) |
| 193 # Get at the top-level directory. This script is in client/tools | 198 # Get at the top-level directory. This script is in client/tools |
| 194 os.chdir(os.path.abspath(os.path.join(scriptdir, os.pardir, os.pardir))) | 199 os.chdir(os.path.abspath(os.path.join(scriptdir, os.pardir, os.pardir))) |
| 195 | 200 |
| 196 (name, version, component, mode, platform) = GetBuildInfo() | 201 (name, version, component, mode, platform) = GetBuildInfo() |
| 197 if name.startswith('dart-editor'): | 202 if name.startswith('dart-editor'): |
| 198 status = ProcessTools(mode, name, version) | 203 status = ProcessTools(mode, name, version) |
| 199 #TODO(sigmund): remove this indirection once we update our bots | 204 #TODO(sigmund): remove this indirection once we update our bots |
| 200 elif name.startswith('frog'): | 205 elif name.startswith('frog'): |
| 201 status = ProcessFrog() | 206 status = ProcessFrog(name) |
| 202 else: | 207 else: |
| 203 status = ProcessDartClientTests(component, mode, platform, name) | 208 status = ProcessDartClientTests(component, mode, platform, name) |
| 204 | 209 |
| 205 if status: | 210 if status: |
| 206 print '@@@STEP_FAILURE@@@' | 211 print '@@@STEP_FAILURE@@@' |
| 207 | 212 |
| 208 return status | 213 return status |
| 209 | 214 |
| 210 | 215 |
| 211 if __name__ == '__main__': | 216 if __name__ == '__main__': |
| 212 sys.exit(main()) | 217 sys.exit(main()) |
| OLD | NEW |