Chromium Code Reviews| Index: Source/WebCore/bindings/dart/gyp/scripts/build_dart_snapshot.py |
| diff --git a/Source/WebCore/bindings/dart/gyp/scripts/build_dart_snapshot.py b/Source/WebCore/bindings/dart/gyp/scripts/build_dart_snapshot.py |
| index 74b5e8105408ad659ebdd0798cb00f32bade66cd..48640bd4b2b6a764999e90181894dbc8082e3b5a 100644 |
| --- a/Source/WebCore/bindings/dart/gyp/scripts/build_dart_snapshot.py |
| +++ b/Source/WebCore/bindings/dart/gyp/scripts/build_dart_snapshot.py |
| @@ -73,12 +73,18 @@ def main(args): |
| assert(len(args) == 7) |
| idlListFileName = args[1] |
| dartPath = args[2] |
| - webkitDartResourcesPath = args[3] |
| + dartSnapshotTemplateFile = args[3] |
| outputFilePath = args[4] |
| genSnapshotBinPath = args[5] |
| - domCommonPath = os.path.relpath(os.path.join(dartPath, 'client', 'dom', 'common'), outputFilePath) |
| - webkitDartResourcesPath = os.path.relpath(webkitDartResourcesPath, outputFilePath) |
| + dartScriptDir = os.path.join(dartPath, 'client', 'dom', 'scripts') |
| + sys.path.insert(0, dartScriptDir) |
| + |
| + import fremontcutbuilder |
| + #fremontcutbuilder.main() |
|
Anton Muhin
2012/01/26 12:13:35
if you're going to commit it, please, remove comme
podivilov
2012/01/30 18:27:54
Done.
|
| + |
| + import dartdomgenerator |
|
Anton Muhin
2012/01/26 12:13:35
nit: may we move import into standard place?
podivilov
2012/01/30 18:27:54
Please note sys.path.insert above.
antonm
2012/01/31 10:48:02
I see. May you group sys.path manipulations and i
|
| + dartdomgenerator.GenerateDOM(True, outputFilePath) |
|
Anton Muhin
2012/01/26 12:13:35
it might be a good idea to use parameter name here
podivilov
2012/01/30 18:27:54
Done.
|
| # FIXME: proper support of enabled features. |
| EXCLUDED = [ |
| @@ -109,9 +115,6 @@ def main(args): |
| f.write(template % kwargs) |
| f.close() |
| - def forAllInterfaces(s): |
| - return ''.join([s % interfaceName for interfaceName in interfaceNames]) |
| - |
| # Generate snapshot script. |
| write('snapshot.dart', ''' |
| %(copyrightTemplate)s |
| @@ -121,43 +124,6 @@ def main(args): |
| #import("dart:json", prefix: "json"); |
| ''', copyrightTemplate=copyrightTemplate) |
| - # Generate dart:dom library. |
| - write('dom_public.dart', ''' |
| -%(copyrightTemplate)s |
| - |
| -#library("DOM Library"); |
| - |
| -#import("dart:domimpl"); |
| - |
| -#source("%(domCommonPath)s/public.dart"); |
| -#source("%(webkitDartResourcesPath)s/dom_public.dart"); |
| - |
| -%(sources)s |
| -''', copyrightTemplate=copyrightTemplate, |
| - domCommonPath=domCommonPath, |
| - webkitDartResourcesPath=webkitDartResourcesPath, |
| - sources=forAllInterfaces('#source("%s.dart");\n')) |
| - |
| - # Generate dart:domimpl |
| - write('dom_implementation.dart', ''' |
| -%(copyrightTemplate)s |
| - |
| -#library("DOM Implementation Library"); |
| - |
| -#import("dart:coreimpl"); |
| -#import("dart:dom"); |
| -#import("dart:nativewrappers"); |
| - |
| -#source("%(domCommonPath)s/implementation.dart"); |
| -#source("%(webkitDartResourcesPath)s/dom_implementation.dart"); |
| - |
| -%(sources)s |
| - |
| -class DOMWrapperBase extends NativeFieldWrapperClass2 {} |
| -''', copyrightTemplate=copyrightTemplate, |
| - domCommonPath=domCommonPath, |
| - webkitDartResourcesPath=webkitDartResourcesPath, |
| - sources=forAllInterfaces('#source("%sImplementation.dart");\n')) |
| # Generate resolver. |
| resolverClasses = ['Dart' + interfaceName for interfaceName in interfaceNames if not interfaceName.endswith('Callback')] |
| @@ -195,12 +161,12 @@ Dart_NativeFunction snapshotResolver(Dart_Handle name, int argumentCount) |
| 'python', |
| path(dartPath, 'runtime', 'tools', 'create_snapshot_file.py'), |
| '--executable=%s' % path(genSnapshotBinPath), |
| - '--input_cc=%s' % path(outputFilePath, webkitDartResourcesPath, 'DartSnapshot.bytes.template'), |
| + '--input_cc=%s' % dartSnapshotTemplateFile, |
| '--output_bin=%s' % path(outputFilePath, 'DartSnapshot.bin'), |
| '--output=%s' % path(outputFilePath, 'DartSnapshot.bytes'), |
| '--script=%s' % path(outputFilePath, 'snapshot.dart'), |
| - '--url_mapping=dart:dom,%s' % path(outputFilePath, 'dom_public.dart'), |
| - '--url_mapping=dart:domimpl,%s' % path(outputFilePath, 'dom_implementation.dart'), |
| + '--url_mapping=dart:dom,%s' % path(outputFilePath, 'generated', 'dom_public.dart'), |
| + '--url_mapping=dart:domimpl,%s' % path(outputFilePath, 'generated', 'dom_impl.dart'), |
| '--url_mapping=dart:html,%s' % path(dartPath, 'client', 'html', 'release', 'html.dart'), |
| '--url_mapping=dart:htmlimpl,%s' % path(dartPath, 'client', 'html', 'release', 'htmlimpl.dart'), |
| '--url_mapping=dart:json,%s' % path(dartPath, 'client', 'json', 'dart_json.dart'), |