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 css_code_generator | 8 import css_code_generator |
9 import os | 9 import os |
10 import sys | 10 import sys |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 command = ' '.join(['cd', library_dir, ';', | 227 command = ' '.join(['cd', library_dir, ';', |
228 copy_dart_script, output_dir, library_filename]) | 228 copy_dart_script, output_dir, library_filename]) |
229 subprocess.call([command], shell=True) | 229 subprocess.call([command], shell=True) |
230 | 230 |
231 def UpdateCssProperties(): | 231 def UpdateCssProperties(): |
232 """Regenerate the CssStyleDeclaration template file with the current CSS | 232 """Regenerate the CssStyleDeclaration template file with the current CSS |
233 properties.""" | 233 properties.""" |
234 _logger.info('Updating Css Properties.') | 234 _logger.info('Updating Css Properties.') |
235 css_code_generator.GenerateCssTemplateFile() | 235 css_code_generator.GenerateCssTemplateFile() |
236 | 236 |
| 237 CACHED_PATCHES = """ |
| 238 // START_OF_CACHED_PATCHES |
| 239 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 240 // for details. All rights reserved. Use of this source code is governed by a |
| 241 // BSD-style license that can be found in the LICENSE file. |
| 242 |
| 243 // DO NOT EDIT GENERATED FILE. |
| 244 |
| 245 library cached_patches; |
| 246 |
| 247 var cached_patches = { |
| 248 /******************************************************** |
| 249 ***** ***** |
| 250 ***** MUST RUN tools/dartium/generate_patches.sh ***** |
| 251 ***** ***** |
| 252 ********************************************************/ |
| 253 }; |
| 254 """ |
| 255 |
237 def main(): | 256 def main(): |
238 parser = optparse.OptionParser() | 257 parser = optparse.OptionParser() |
239 parser.add_option('--parallel', dest='parallel', | 258 parser.add_option('--parallel', dest='parallel', |
240 action='store_true', default=False, | 259 action='store_true', default=False, |
241 help='Use fremontcut in parallel mode.') | 260 help='Use fremontcut in parallel mode.') |
242 parser.add_option('--systems', dest='systems', | 261 parser.add_option('--systems', dest='systems', |
243 action='store', type='string', | 262 action='store', type='string', |
244 default='htmldart2js,htmldartium,_blink', | 263 default='htmldart2js,htmldartium,_blink', |
245 help='Systems to generate (htmldart2js, htmldartium, _blink)
') | 264 help='Systems to generate (htmldart2js, htmldartium, _blink)
') |
246 parser.add_option('--output-dir', dest='output_dir', | 265 parser.add_option('--output-dir', dest='output_dir', |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 | 339 |
321 if 'htmldartium' in systems: | 340 if 'htmldartium' in systems: |
322 _logger.info('Generating dartium single files.') | 341 _logger.info('Generating dartium single files.') |
323 file_generation_start_time = time.time() | 342 file_generation_start_time = time.time() |
324 | 343 |
325 for library_name in HTML_LIBRARY_NAMES: | 344 for library_name in HTML_LIBRARY_NAMES: |
326 GenerateSingleFile( | 345 GenerateSingleFile( |
327 os.path.join(dartium_output_dir, '%s_dartium.dart' % library_name), | 346 os.path.join(dartium_output_dir, '%s_dartium.dart' % library_name), |
328 os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dartium')) | 347 os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dartium')) |
329 | 348 |
| 349 # Blow away the cached_patches.dart needs to be re-generated for Dartium |
| 350 # see tools/dartium/generate_patches.sh |
| 351 cached_patches_filename = os.path.join('..', '..', '..', 'sdk', 'lib', 'js',
'dartium', |
| 352 'cached_patches.dart') |
| 353 cached_patches = open(cached_patches_filename, 'w') |
| 354 cached_patches.write(CACHED_PATCHES); |
| 355 cached_patches.close() |
| 356 |
330 if '_blink' in systems: | 357 if '_blink' in systems: |
331 _logger.info('Generating dartium _blink file.') | 358 _logger.info('Generating dartium _blink file.') |
332 file_generation_start_time = time.time() | 359 file_generation_start_time = time.time() |
333 | 360 |
334 GenerateSingleFile( | 361 GenerateSingleFile( |
335 os.path.join(dartium_output_dir, '%s_dartium.dart' % '_blink'), | 362 os.path.join(dartium_output_dir, '%s_dartium.dart' % '_blink'), |
336 os.path.join('..', '..', '..', 'sdk', 'lib', '_blink', 'dartium')) | 363 os.path.join('..', '..', '..', 'sdk', 'lib', '_blink', 'dartium')) |
337 | 364 |
338 print '\nGenerating single file %s seconds' % round(time.time() - file_generat
ion_start_time, 2) | 365 print '\nGenerating single file %s seconds' % round(time.time() - file_generat
ion_start_time, 2) |
339 | 366 |
340 end_time = time.time() | 367 end_time = time.time() |
341 | 368 |
342 print '\nDone (dartdomgenerator) %s seconds' % round(end_time - start_time, 2) | 369 print '\nDone (dartdomgenerator) %s seconds' % round(end_time - start_time, 2) |
343 | 370 |
344 if __name__ == '__main__': | 371 if __name__ == '__main__': |
345 sys.exit(main()) | 372 sys.exit(main()) |
OLD | NEW |