| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // Enumerate core libraries and apply patches | 97 // Enumerate core libraries and apply patches |
| 98 for (SdkLibrary library in sdkLibraries) { | 98 for (SdkLibrary library in sdkLibraries) { |
| 99 if (forDart2js && library.isVmLibrary) continue; | 99 if (forDart2js && library.isVmLibrary) continue; |
| 100 if (forVm && library.isDart2JsLibrary) continue; | 100 if (forVm && library.isDart2JsLibrary) continue; |
| 101 _applyPatch(library, sdkLibIn, patchIn, sdkOut); | 101 _applyPatch(library, sdkLibIn, patchIn, sdkOut); |
| 102 } | 102 } |
| 103 | 103 |
| 104 if (forVm) _copyExtraVmLibraries(sdkOut); | 104 if (forVm) _copyExtraVmLibraries(sdkOut); |
| 105 | 105 |
| 106 Uri platform = outDirUri.resolve('platform.dill.tmp'); | 106 Uri platform = outDirUri.resolve('platform.dill.tmp'); |
| 107 Uri outline = outDirUri.resolve('outline.dill'); |
| 107 Uri packages = Uri.base.resolveUri(new Uri.file(packagesFile)); | 108 Uri packages = Uri.base.resolveUri(new Uri.file(packagesFile)); |
| 108 if (forVm) { | 109 if (forVm) { |
| 109 await fasta.compilePlatform(outDirUri, platform, packages: packages); | 110 await fasta.compilePlatform(outDirUri, platform, |
| 111 packages: packages, outlineOutput: outline); |
| 110 } else { | 112 } else { |
| 111 await dart2js.compilePlatform(outDirUri, platform, packages: packages); | 113 await dart2js.compilePlatform(outDirUri, platform, |
| 114 packages: packages, outlineOutput: outline); |
| 112 } | 115 } |
| 113 | 116 |
| 114 Uri platformFinalLocation = outDirUri.resolve('platform.dill'); | 117 Uri platformFinalLocation = outDirUri.resolve('platform.dill'); |
| 115 | 118 |
| 116 // To properly regenerate the patched_sdk, patched_dart2js_sdk, and | 119 // To properly regenerate the patched_sdk, patched_dart2js_sdk, and |
| 117 // platform.dill only when necessary, we track dependencies as follows: | 120 // platform.dill only when necessary, we track dependencies as follows: |
| 118 // - inputs like the sdk libraries and patch files are covered by the | 121 // - inputs like the sdk libraries and patch files are covered by the |
| 119 // extraDependencies argument. | 122 // extraDependencies argument. |
| 120 // - this script and its script dependencies are handled by writeDepsFile | 123 // - this script and its script dependencies are handled by writeDepsFile |
| 121 // here. | 124 // here. |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 if (diff != 0) return diff; | 609 if (diff != 0) return diff; |
| 607 return end - other.end; | 610 return end - other.end; |
| 608 } | 611 } |
| 609 } | 612 } |
| 610 | 613 |
| 611 List<SdkLibrary> _getSdkLibraries(String contents) { | 614 List<SdkLibrary> _getSdkLibraries(String contents) { |
| 612 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true); | 615 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true); |
| 613 parseCompilationUnit(contents).accept(libraryBuilder); | 616 parseCompilationUnit(contents).accept(libraryBuilder); |
| 614 return libraryBuilder.librariesMap.sdkLibraries; | 617 return libraryBuilder.librariesMap.sdkLibraries; |
| 615 } | 618 } |
| OLD | NEW |