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:isolate' show RawReceivePort; | 10 import 'dart:isolate' show RawReceivePort; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 "_builtin/_builtin.dart", | 161 "_builtin/_builtin.dart", |
162 categories: "Client,Server", | 162 categories: "Client,Server", |
163 implementation: true, | 163 implementation: true, |
164 documented: false, | 164 documented: false, |
165 platforms: VM_PLATFORM), | 165 platforms: VM_PLATFORM), |
166 | 166 |
167 "profiler": const LibraryInfo( | 167 "profiler": const LibraryInfo( |
168 "profiler/profiler.dart", | 168 "profiler/profiler.dart", |
169 maturity: Maturity.DEPRECATED, | 169 maturity: Maturity.DEPRECATED, |
170 documented: false), | 170 documented: false), |
171 | |
172 "_vmservice": const LibraryInfo( | |
173 "vmservice/vmservice.dart", | |
174 implementation: true, | |
175 documented: false, | |
176 platforms: VM_PLATFORM), | |
177 | |
178 "vmservice_io": const LibraryInfo( | |
179 "vmservice_io/vmservice_io.dart", | |
180 implementation: true, | |
181 documented: false, | |
182 platforms: VM_PLATFORM), | |
183 | |
184 '''); | 171 '''); |
185 _writeSync( | 172 _writeSync( |
186 path.join( | 173 path.join( |
187 sdkOut, '_internal', 'sdk_library_metadata', 'lib', 'libraries.dart'), | 174 sdkOut, '_internal', 'sdk_library_metadata', 'lib', 'libraries.dart'), |
188 libContents); | 175 libContents); |
189 return libContents; | 176 return libContents; |
190 } | 177 } |
191 | 178 |
192 /// Copy internal libraries that are developed under 'runtime/bin/' to the | 179 /// Copy internal libraries that are developed under 'runtime/bin/' to the |
193 /// patched_sdk folder. | 180 /// patched_sdk folder. |
(...skipping 13 matching lines...) Expand all Loading... |
207 _writeSync(builtinLibraryOut, readInputFile(builtinLibraryIn)); | 194 _writeSync(builtinLibraryOut, readInputFile(builtinLibraryIn)); |
208 locations[vmLibrary] = path.join(vmLibrary, '${vmLibrary}.dart'); | 195 locations[vmLibrary] = path.join(vmLibrary, '${vmLibrary}.dart'); |
209 } | 196 } |
210 | 197 |
211 for (var file in ['loader.dart', 'server.dart', 'vmservice_io.dart']) { | 198 for (var file in ['loader.dart', 'server.dart', 'vmservice_io.dart']) { |
212 var libraryIn = path.join(dartDir, 'runtime', 'bin', 'vmservice', file); | 199 var libraryIn = path.join(dartDir, 'runtime', 'bin', 'vmservice', file); |
213 var libraryOut = path.join(sdkOut, 'vmservice_io', file); | 200 var libraryOut = path.join(sdkOut, 'vmservice_io', file); |
214 _writeSync(libraryOut, readInputFile(libraryIn)); | 201 _writeSync(libraryOut, readInputFile(libraryIn)); |
215 } | 202 } |
216 locations["vmservice_io"] = "vmservice_io/vmservice_io.dart"; | 203 locations["vmservice_io"] = "vmservice_io/vmservice_io.dart"; |
| 204 locations["_vmservice"] = "vmservice/vmservice.dart"; |
217 } | 205 } |
218 | 206 |
219 _applyPatch(SdkLibrary library, String sdkLibIn, String patchIn, String sdkOut, | 207 _applyPatch(SdkLibrary library, String sdkLibIn, String patchIn, String sdkOut, |
220 Map<String, String> locations) { | 208 Map<String, String> locations) { |
221 var libraryOut = path.join(sdkLibIn, library.path); | 209 var libraryOut = path.join(sdkLibIn, library.path); |
222 var libraryIn = libraryOut; | 210 var libraryIn = libraryOut; |
223 | 211 |
224 var libraryFile = getInputFile(libraryIn, canBeMissing: true); | 212 var libraryFile = getInputFile(libraryIn, canBeMissing: true); |
225 if (libraryFile != null) { | 213 if (libraryFile != null) { |
226 locations[Uri.parse(library.shortName).path] = | 214 locations[Uri.parse(library.shortName).path] = |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 if (diff != 0) return diff; | 610 if (diff != 0) return diff; |
623 return end - other.end; | 611 return end - other.end; |
624 } | 612 } |
625 } | 613 } |
626 | 614 |
627 List<SdkLibrary> _getSdkLibraries(String contents, bool useDart2js) { | 615 List<SdkLibrary> _getSdkLibraries(String contents, bool useDart2js) { |
628 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(useDart2js); | 616 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(useDart2js); |
629 parseCompilationUnit(contents).accept(libraryBuilder); | 617 parseCompilationUnit(contents).accept(libraryBuilder); |
630 return libraryBuilder.librariesMap.sdkLibraries; | 618 return libraryBuilder.librariesMap.sdkLibraries; |
631 } | 619 } |
OLD | NEW |