OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import 'dart:io'; |
| 6 |
| 7 import 'package:analyzer/src/summary/idl.dart'; |
| 8 import 'package:args/args.dart'; |
| 9 |
| 10 main(List<String> args) { |
| 11 ArgParser argParser = new ArgParser()..addFlag('raw'); |
| 12 ArgResults argResults = argParser.parse(args); |
| 13 if (argResults.rest.length != 1) { |
| 14 print(argParser.usage); |
| 15 exitCode = 1; |
| 16 return; |
| 17 } |
| 18 |
| 19 String path = argResults.rest[0]; |
| 20 List<int> bytes = new File(path).readAsBytesSync(); |
| 21 AnalysisDriverExceptionContext context = |
| 22 new AnalysisDriverExceptionContext.fromBuffer(bytes); |
| 23 |
| 24 print(context.path); |
| 25 print(''); |
| 26 print(''); |
| 27 print(''); |
| 28 |
| 29 print(context.exception); |
| 30 print(''); |
| 31 print(''); |
| 32 print(''); |
| 33 |
| 34 print(context.stackTrace); |
| 35 print(''); |
| 36 print(''); |
| 37 print(''); |
| 38 |
| 39 context.files.forEach((file) { |
| 40 print("=" * 40); |
| 41 print('${file.path}'); |
| 42 print("-" * 40); |
| 43 print('${file.content}'); |
| 44 print(''); |
| 45 print(''); |
| 46 print(''); |
| 47 }); |
| 48 } |
OLD | NEW |