| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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 # A script which makes it easy to execute common DOM-related tasks | 7 # A script which makes it easy to execute common DOM-related tasks |
| 8 | 8 |
| 9 import os | 9 import os |
| 10 import subprocess | 10 import subprocess |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 return call([ | 51 return call([ |
| 52 os.path.join('tools', 'build.py'), | 52 os.path.join('tools', 'build.py'), |
| 53 '--mode=release', | 53 '--mode=release', |
| 54 '--arch=ia32', | 54 '--arch=ia32', |
| 55 'runtime', | 55 'runtime', |
| 56 ]) | 56 ]) |
| 57 | 57 |
| 58 def dart2js(): | 58 def dart2js(): |
| 59 compile_dart2js(argv.pop(0), True) | 59 compile_dart2js(argv.pop(0), True) |
| 60 | 60 |
| 61 def dartc(): | |
| 62 return call([ | |
| 63 os.path.join('tools', 'test.py'), | |
| 64 '-m', | |
| 65 'release', | |
| 66 '-c', | |
| 67 'dartc', | |
| 68 '-r', | |
| 69 'none' | |
| 70 ]) | |
| 71 | |
| 72 def docs(): | 61 def docs(): |
| 73 return call([ | 62 return call([ |
| 74 os.path.join(dart_out_dir, 'dart-sdk', 'bin', 'dart'), | 63 os.path.join(dart_out_dir, 'dart-sdk', 'bin', 'dart'), |
| 75 '--package-root=%s' % os.path.join(dart_out_dir, 'packages/'), | 64 '--package-root=%s' % os.path.join(dart_out_dir, 'packages/'), |
| 76 os.path.join('tools', 'dom', 'docs', 'bin', 'docs.dart'), | 65 os.path.join('tools', 'dom', 'docs', 'bin', 'docs.dart'), |
| 77 ]) | 66 ]) |
| 78 | 67 |
| 79 def test_docs(): | 68 def test_docs(): |
| 80 return call([ | 69 return call([ |
| 81 os.path.join('tools', 'test.py'), | 70 os.path.join('tools', 'test.py'), |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 if output: | 158 if output: |
| 170 print output | 159 print output |
| 171 if error: | 160 if error: |
| 172 print error | 161 print error |
| 173 return pipe.returncode | 162 return pipe.returncode |
| 174 | 163 |
| 175 commands = { | 164 commands = { |
| 176 'analyze': [analyze, 'Run the dart analyzer'], | 165 'analyze': [analyze, 'Run the dart analyzer'], |
| 177 'build': [build, 'Build dart in release mode'], | 166 'build': [build, 'Build dart in release mode'], |
| 178 'dart2js': [dart2js, 'Run dart2js on the .dart file specified'], | 167 'dart2js': [dart2js, 'Run dart2js on the .dart file specified'], |
| 179 'dartc': [dartc, 'Runs dartc in release mode'], | |
| 180 'docs': [docs, 'Generates docs.json'], | 168 'docs': [docs, 'Generates docs.json'], |
| 181 'gen': [gen, 'Re-generate DOM generated files (run go.sh)'], | 169 'gen': [gen, 'Re-generate DOM generated files (run go.sh)'], |
| 182 'size_check': [size_check, 'Check the size of dart2js compiled Swarm'], | 170 'size_check': [size_check, 'Check the size of dart2js compiled Swarm'], |
| 183 'test_docs': [test_docs, 'Tests docs.dart'], | 171 'test_docs': [test_docs, 'Tests docs.dart'], |
| 184 'test_chrome': [test_chrome, 'Run tests in checked mode in Chrome.\n' | 172 'test_chrome': [test_chrome, 'Run tests in checked mode in Chrome.\n' |
| 185 '\t\tOptionally provide name of test to run.'], | 173 '\t\tOptionally provide name of test to run.'], |
| 186 # TODO(antonm): fix option name. | 174 # TODO(antonm): fix option name. |
| 187 'test_drt': [test_drt, 'Run tests in checked mode in content shell.\n' | 175 'test_drt': [test_drt, 'Run tests in checked mode in content shell.\n' |
| 188 '\t\tOptionally provide name of test to run.'], | 176 '\t\tOptionally provide name of test to run.'], |
| 189 'test_ff': [test_ff, 'Run tests in checked mode in Firefox.\n' | 177 'test_ff': [test_ff, 'Run tests in checked mode in Firefox.\n' |
| (...skipping 19 matching lines...) Expand all Loading... |
| 209 help(); | 197 help(); |
| 210 success = False | 198 success = False |
| 211 break | 199 break |
| 212 returncode = commands[command][0]() | 200 returncode = commands[command][0]() |
| 213 success = success and not bool(returncode) | 201 success = success and not bool(returncode) |
| 214 | 202 |
| 215 sys.exit(not success) | 203 sys.exit(not success) |
| 216 | 204 |
| 217 if __name__ == '__main__': | 205 if __name__ == '__main__': |
| 218 main() | 206 main() |
| OLD | NEW |