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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 'docs' | 73 'docs' |
74 ]) | 74 ]) |
75 | 75 |
76 def compile_dart2js(dart_file, checked): | 76 def compile_dart2js(dart_file, checked): |
77 out_file = dart_file + '.js' | 77 out_file = dart_file + '.js' |
78 dart2js_path = os.path.join(dart_out_dir, 'dart-sdk', 'bin', 'dart2js') | 78 dart2js_path = os.path.join(dart_out_dir, 'dart-sdk', 'bin', 'dart2js') |
79 args = [ | 79 args = [ |
80 dart2js_path, | 80 dart2js_path, |
81 dart_file, | 81 dart_file, |
82 '--library-root=sdk/', | 82 '--library-root=sdk/', |
83 '--disallow-unsafe-eval', | |
floitsch
2013/10/24 18:27:30
unrelated change?
Emily Fortuna
2013/10/24 18:28:27
It's actually related. We use this script to test
| |
84 '-o%s' % out_file | 83 '-o%s' % out_file |
85 ] | 84 ] |
86 if checked: | 85 if checked: |
87 args.append('--checked') | 86 args.append('--checked') |
88 | 87 |
89 call(args) | 88 call(args) |
90 return out_file | 89 return out_file |
91 | 90 |
92 def gen(): | 91 def gen(): |
93 os.chdir(os.path.join('tools', 'dom', 'scripts')) | 92 os.chdir(os.path.join('tools', 'dom', 'scripts')) |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 help(); | 205 help(); |
207 success = False | 206 success = False |
208 break | 207 break |
209 returncode = commands[command][0]() | 208 returncode = commands[command][0]() |
210 success = success and not bool(returncode) | 209 success = success and not bool(returncode) |
211 | 210 |
212 sys.exit(not success) | 211 sys.exit(not success) |
213 | 212 |
214 if __name__ == '__main__': | 213 if __name__ == '__main__': |
215 main() | 214 main() |
OLD | NEW |