| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 Generate(implementation_system) | 109 Generate(implementation_system) |
| 110 | 110 |
| 111 _logger.info('Flush...') | 111 _logger.info('Flush...') |
| 112 emitters.Flush() | 112 emitters.Flush() |
| 113 | 113 |
| 114 def GenerateSingleFile(systems): | 114 def GenerateSingleFile(systems): |
| 115 if 'frog' in systems: | 115 if 'frog' in systems: |
| 116 _logger.info('Copy dom_frog to frog/') | 116 _logger.info('Copy dom_frog to frog/') |
| 117 subprocess.call(['cd ../generated ; ' | 117 subprocess.call(['cd ../generated ; ' |
| 118 '../../../tools/copy_dart.py ../frog dom_frog.dart'], | 118 '../../../tools/copy_dart.py ../frog dom_frog.dart'], |
| 119 shell=True); | 119 shell=True) |
| 120 | 120 |
| 121 if 'htmlfrog' in systems: | 121 if 'htmlfrog' in systems: |
| 122 _logger.info('Copy html_frog to ../html/frog/') | 122 _logger.info('Copy html_frog to ../html/frog/') |
| 123 subprocess.call(['cd ../../html/generated ; ' | 123 subprocess.call(['cd ../../html/generated ; ' |
| 124 '../../../tools/copy_dart.py ../frog html_frog.dart'], | 124 '../../../tools/copy_dart.py ../frog html_frog.dart'], |
| 125 shell=True); | 125 shell=True) |
| 126 | 126 |
| 127 if 'htmldartium' in systems: | 127 if 'htmldartium' in systems: |
| 128 _logger.info('Copy html_dartium to ../html/dartium/') | 128 _logger.info('Copy html_dartium to ../html/dartium/') |
| 129 subprocess.call(['cd ../../html/generated ; ' | 129 subprocess.call(['cd ../../html/generated ; ' |
| 130 '../../../tools/copy_dart.py ../dartium html_dartium.dart']
, | 130 '../../../tools/copy_dart.py ../dartium html_dartium.dart']
, |
| 131 shell=True); | 131 shell=True) |
| 132 | 132 |
| 133 # Copy dummy DOM where dartc build expects it. | 133 # Copy dummy DOM where dartc build expects it. |
| 134 if 'dummy' in systems: | 134 if 'dummy' in systems: |
| 135 _logger.info('Copy dom_dummy to dom.dart') | 135 _logger.info('Copy dom_dummy to dom.dart') |
| 136 subprocess.call(['cd ../generated ; ' | 136 subprocess.call(['cd ../generated ; ' |
| 137 '../../../tools/copy_dart.py dummy dom_dummy.dart ;' | 137 '../../../tools/copy_dart.py dummy dom_dummy.dart ;' |
| 138 'cp dummy/dom_dummy.dart ../dom.dart'], | 138 'cp dummy/dom_dummy.dart ../dom.dart'], |
| 139 shell=True); | 139 shell=True) |
| 140 | 140 |
| 141 def main(): | 141 def main(): |
| 142 parser = optparse.OptionParser() | 142 parser = optparse.OptionParser() |
| 143 parser.add_option('--systems', dest='systems', | 143 parser.add_option('--systems', dest='systems', |
| 144 action='store', type='string', | 144 action='store', type='string', |
| 145 default='frog,dummy,htmlfrog,htmldartium', | 145 default='frog,dummy,htmlfrog,htmldartium', |
| 146 help='Systems to generate (frog, dummy, ' | 146 help='Systems to generate (frog, dummy, ' |
| 147 'htmlfrog, htmldartium)') | 147 'htmlfrog, htmldartium)') |
| 148 parser.add_option('--output-dir', dest='output_dir', | 148 parser.add_option('--output-dir', dest='output_dir', |
| 149 action='store', type='string', | 149 action='store', type='string', |
| (...skipping 14 matching lines...) Expand all Loading... |
| 164 dom_output_dir = options.output_dir or os.path.join(current_dir, | 164 dom_output_dir = options.output_dir or os.path.join(current_dir, |
| 165 '../generated') | 165 '../generated') |
| 166 html_output_dir = options.output_dir or os.path.join(current_dir, | 166 html_output_dir = options.output_dir or os.path.join(current_dir, |
| 167 '../../html/generated') | 167 '../../html/generated') |
| 168 Generate(systems, database_dir, options.use_database_cache, | 168 Generate(systems, database_dir, options.use_database_cache, |
| 169 dom_output_dir, html_output_dir) | 169 dom_output_dir, html_output_dir) |
| 170 GenerateSingleFile(systems) | 170 GenerateSingleFile(systems) |
| 171 | 171 |
| 172 if __name__ == '__main__': | 172 if __name__ == '__main__': |
| 173 sys.exit(main()) | 173 sys.exit(main()) |
| OLD | NEW |