OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 """This is the entry point to create Dart APIs from the IDL database.""" | 6 """This is the entry point to create Dart APIs from the IDL database.""" |
7 | 7 |
8 import dartgenerator | 8 import dartgenerator |
9 import database | 9 import database |
10 import logging.config | 10 import logging.config |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 common_prefix = 'common', | 83 common_prefix = 'common', |
84 super_map = _webkit_renames_inverse, | 84 super_map = _webkit_renames_inverse, |
85 systems = systems) | 85 systems = systems) |
86 | 86 |
87 generator.Flush() | 87 generator.Flush() |
88 | 88 |
89 def main(): | 89 def main(): |
90 parser = optparse.OptionParser() | 90 parser = optparse.OptionParser() |
91 parser.add_option('--systems', dest='systems', | 91 parser.add_option('--systems', dest='systems', |
92 action='store', type='string', | 92 action='store', type='string', |
93 default='frog,dummy', | 93 default='frog,dummy,wrapping,htmlfrog', |
94 help='Systems to generate (frog, native, dummy)') | 94 help='Systems to generate (frog, native, dummy, ' |
| 95 'htmlfrog)') |
95 parser.add_option('--output-dir', dest='output_dir', | 96 parser.add_option('--output-dir', dest='output_dir', |
96 action='store', type='string', | 97 action='store', type='string', |
97 default=None, | 98 default=None, |
98 help='Directory to put the generated files') | 99 help='Directory to put the generated files') |
99 (options, args) = parser.parse_args() | 100 (options, args) = parser.parse_args() |
100 | 101 |
101 current_dir = os.path.dirname(__file__) | 102 current_dir = os.path.dirname(__file__) |
102 output_dir = options.output_dir or os.path.join(current_dir, '..') | 103 output_dir = options.output_dir or os.path.join(current_dir, '..') |
103 systems = options.systems.split(',') | 104 systems = options.systems.split(',') |
104 | 105 |
105 logging.config.fileConfig(os.path.join(current_dir, 'logging.conf')) | 106 logging.config.fileConfig(os.path.join(current_dir, 'logging.conf')) |
106 GenerateDOM(systems, output_dir) | 107 GenerateDOM(systems, output_dir) |
107 | 108 |
108 if DEFAULT_SYSTEM in systems: | 109 if DEFAULT_SYSTEM in systems: |
109 # Install default DOM library. | 110 # Install default DOM library. |
110 default = os.path.join(output_dir, DOM_DEFAULT_LIBRARY) | 111 default = os.path.join(output_dir, DOM_DEFAULT_LIBRARY) |
111 target = os.path.join(output_dir, DOM_LIBRARY) | 112 target = os.path.join(output_dir, DOM_LIBRARY) |
112 shutil.copyfile(default, target) | 113 shutil.copyfile(default, target) |
113 | 114 |
114 if __name__ == '__main__': | 115 if __name__ == '__main__': |
115 sys.exit(main()) | 116 sys.exit(main()) |
OLD | NEW |