OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import os | 6 import os |
7 import sys | 7 import sys |
8 | 8 |
9 # Note: some of these files are imported to register cmdline options. | 9 # Note: some of these files are imported to register cmdline options. |
10 from idl_generator import Generator | 10 from idl_generator import Generator |
(...skipping 18 matching lines...) Expand all Loading... |
29 script_dir = os.path.abspath(os.path.dirname(__file__)) | 29 script_dir = os.path.abspath(os.path.dirname(__file__)) |
30 if current_dir != script_dir: | 30 if current_dir != script_dir: |
31 print '\nIncorrect CWD, default run skipped.' | 31 print '\nIncorrect CWD, default run skipped.' |
32 print 'When running with no arguments set CWD to the scripts directory:' | 32 print 'When running with no arguments set CWD to the scripts directory:' |
33 print '\t' + script_dir + '\n' | 33 print '\t' + script_dir + '\n' |
34 print 'This ensures correct default paths and behavior.\n' | 34 print 'This ensures correct default paths and behavior.\n' |
35 return 1 | 35 return 1 |
36 | 36 |
37 filenames = ParseOptions(args) | 37 filenames = ParseOptions(args) |
38 ast = ParseFiles(filenames) | 38 ast = ParseFiles(filenames) |
| 39 if ast.errors: |
| 40 print 'Found %d errors. Aborting build.\n' % ast.errors |
| 41 return 1 |
39 return Generator.Run(ast) | 42 return Generator.Run(ast) |
40 | 43 |
41 | 44 |
42 if __name__ == '__main__': | 45 if __name__ == '__main__': |
43 sys.exit(Main()) | 46 sys.exit(Main()) |
| 47 |
OLD | NEW |