| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 parser.add_option('--systems', dest='systems', | 155 parser.add_option('--systems', dest='systems', |
| 156 action='store', type='string', | 156 action='store', type='string', |
| 157 default='frog,dummy,wrapping', | 157 default='frog,dummy,wrapping', |
| 158 help='Systems to generate (frog, native, dummy, ' | 158 help='Systems to generate (frog, native, dummy, ' |
| 159 'htmlfrog, htmldartium)') | 159 'htmlfrog, htmldartium)') |
| 160 parser.add_option('--output-dir', dest='output_dir', | 160 parser.add_option('--output-dir', dest='output_dir', |
| 161 action='store', type='string', | 161 action='store', type='string', |
| 162 default=None, | 162 default=None, |
| 163 help='Directory to put the generated files') | 163 help='Directory to put the generated files') |
| 164 parser.add_option('--use-database-cache', dest='use_database_cache', | 164 parser.add_option('--use-database-cache', dest='use_database_cache', |
| 165 action='store', | 165 action='store_true', |
| 166 default=False, | 166 default=False, |
| 167 help='''Use the cached database from the previous run to | 167 help='''Use the cached database from the previous run to |
| 168 improve startup performance''') | 168 improve startup performance''') |
| 169 (options, args) = parser.parse_args() | 169 (options, args) = parser.parse_args() |
| 170 | 170 |
| 171 current_dir = os.path.dirname(__file__) | 171 current_dir = os.path.dirname(__file__) |
| 172 systems = options.systems.split(',') | 172 systems = options.systems.split(',') |
| 173 num_html_systems = ('htmlfrog' in systems) + ('htmldartium' in systems) | 173 num_html_systems = ('htmlfrog' in systems) + ('htmldartium' in systems) |
| 174 if num_html_systems > 0 and num_html_systems < len(systems): | 174 if num_html_systems > 0 and num_html_systems < len(systems): |
| 175 print 'Cannot generate html and dom bindings at the same time' | 175 print 'Cannot generate html and dom bindings at the same time' |
| (...skipping 12 matching lines...) Expand all Loading... |
| 188 # Copy dummy DOM where dartc build expects it. | 188 # Copy dummy DOM where dartc build expects it. |
| 189 if 'dummy' in systems: | 189 if 'dummy' in systems: |
| 190 # TODO(sra): Make other tools pick this up directly, or do a copy_dart into | 190 # TODO(sra): Make other tools pick this up directly, or do a copy_dart into |
| 191 # a specific directory. | 191 # a specific directory. |
| 192 source = os.path.join(output_dir, 'dom_dummy.dart') | 192 source = os.path.join(output_dir, 'dom_dummy.dart') |
| 193 target = os.path.join(output_dir, 'dom.dart') | 193 target = os.path.join(output_dir, 'dom.dart') |
| 194 shutil.copyfile(source, target) | 194 shutil.copyfile(source, target) |
| 195 | 195 |
| 196 if __name__ == '__main__': | 196 if __name__ == '__main__': |
| 197 sys.exit(main()) | 197 sys.exit(main()) |
| OLD | NEW |