OLD | NEW |
1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
2 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2015, 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 /// Command line tool to merge the SDK libraries and our patch files. | 6 /// Command line tool to merge the SDK libraries and our patch files. |
7 /// This is currently designed as an offline tool, but we could automate it. | 7 /// This is currently designed as an offline tool, but we could automate it. |
8 | 8 |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 import 'dart:async'; | 10 import 'dart:async'; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 var mode = argv[0]; | 72 var mode = argv[0]; |
73 assert(mode == "vm"); | 73 assert(mode == "vm"); |
74 var input = argv[1]; | 74 var input = argv[1]; |
75 var sdkLibIn = path.join(input, 'lib'); | 75 var sdkLibIn = path.join(input, 'lib'); |
76 var patchIn = argv[2]; | 76 var patchIn = argv[2]; |
77 var outDir = argv[3]; | 77 var outDir = argv[3]; |
78 var sdkOut = path.join(outDir, 'lib'); | 78 var sdkOut = path.join(outDir, 'lib'); |
79 var packagesFile = argv[4]; | 79 var packagesFile = argv[4]; |
80 | 80 |
81 var privateIn = path.join(input, 'private'); | |
82 var INTERNAL_PATH = '_internal/compiler/js_lib/'; | |
83 | |
84 // Copy and patch libraries.dart and version | 81 // Copy and patch libraries.dart and version |
85 var libContents = readInputFile(path.join( | 82 var libContents = readInputFile(path.join( |
86 sdkLibIn, '_internal', 'sdk_library_metadata', 'lib', 'libraries.dart')); | 83 sdkLibIn, '_internal', 'sdk_library_metadata', 'lib', 'libraries.dart')); |
87 libContents = libContents.replaceAll( | 84 libContents = libContents.replaceAll( |
88 ' libraries = const {', | 85 ' libraries = const {', |
89 ''' libraries = const { | 86 ''' libraries = const { |
90 | 87 |
91 "_builtin": const LibraryInfo( | 88 "_builtin": const LibraryInfo( |
92 "_builtin/_builtin.dart", | 89 "_builtin/_builtin.dart", |
93 categories: "Client,Server", | 90 categories: "Client,Server", |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 if (diff != 0) return diff; | 604 if (diff != 0) return diff; |
608 return end - other.end; | 605 return end - other.end; |
609 } | 606 } |
610 } | 607 } |
611 | 608 |
612 List<SdkLibrary> _getSdkLibraries(String contents) { | 609 List<SdkLibrary> _getSdkLibraries(String contents) { |
613 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true); | 610 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true); |
614 parseCompilationUnit(contents).accept(libraryBuilder); | 611 parseCompilationUnit(contents).accept(libraryBuilder); |
615 return libraryBuilder.librariesMap.sdkLibraries; | 612 return libraryBuilder.librariesMap.sdkLibraries; |
616 } | 613 } |
OLD | NEW |