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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // TODO(kustermann): We suppress compiler hints/warnings/errors temporarily | 199 // TODO(kustermann): We suppress compiler hints/warnings/errors temporarily |
200 // because everyone building the `runtime` target will get these now. | 200 // because everyone building the `runtime` target will get these now. |
201 // We should remove the suppression again once the underlying issues have | 201 // We should remove the suppression again once the underlying issues have |
202 // been fixed (either in fasta or the dart files in the patched_sdk). | 202 // been fixed (either in fasta or the dart files in the patched_sdk). |
203 final capturedLines = <String>[]; | 203 final capturedLines = <String>[]; |
204 try { | 204 try { |
205 await runZoned(() async { | 205 await runZoned(() async { |
206 await compile_platform.main(<String>[ | 206 await compile_platform.main(<String>[ |
207 '--packages', | 207 '--packages', |
208 new Uri.file(packagesFile).toString(), | 208 new Uri.file(packagesFile).toString(), |
209 outDir, | 209 new Uri.directory(outDir).toString(), |
210 path.join(outDir, 'platform.dill') | 210 path.join(outDir, 'platform.dill') |
211 ]); | 211 ]); |
212 }, zoneSpecification: new ZoneSpecification(print: (_, _2, _3, line) { | 212 }, zoneSpecification: new ZoneSpecification(print: (_, _2, _3, line) { |
213 capturedLines.add(line); | 213 capturedLines.add(line); |
214 })); | 214 })); |
215 } catch (_) { | 215 } catch (_) { |
216 for (final line in capturedLines) { | 216 for (final line in capturedLines) { |
217 print(line); | 217 print(line); |
218 } | 218 } |
219 rethrow; | 219 rethrow; |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 if (diff != 0) return diff; | 554 if (diff != 0) return diff; |
555 return end - other.end; | 555 return end - other.end; |
556 } | 556 } |
557 } | 557 } |
558 | 558 |
559 List<SdkLibrary> _getSdkLibraries(String contents) { | 559 List<SdkLibrary> _getSdkLibraries(String contents) { |
560 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true); | 560 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true); |
561 parseCompilationUnit(contents).accept(libraryBuilder); | 561 parseCompilationUnit(contents).accept(libraryBuilder); |
562 return libraryBuilder.librariesMap.sdkLibraries; | 562 return libraryBuilder.librariesMap.sdkLibraries; |
563 } | 563 } |
OLD | NEW |