| OLD | NEW |
| 1 import 'dart:io'; | 1 import 'dart:io'; |
| 2 | 2 |
| 3 import 'package:analyzer/dart/ast/ast.dart'; | 3 import 'package:analyzer/dart/ast/ast.dart'; |
| 4 import 'package:analyzer/dart/element/element.dart'; | 4 import 'package:analyzer/dart/element/element.dart'; |
| 5 import 'package:analyzer/src/generated/engine.dart'; | 5 import 'package:analyzer/src/generated/engine.dart'; |
| 6 import 'package:analyzer/src/generated/java_io.dart'; | 6 import 'package:analyzer/src/generated/java_io.dart'; |
| 7 import 'package:analyzer/src/generated/sdk.dart'; | 7 import 'package:analyzer/src/generated/sdk.dart'; |
| 8 import 'package:analyzer/src/generated/sdk_io.dart'; | 8 import 'package:analyzer/src/generated/sdk_io.dart'; |
| 9 import 'package:analyzer/src/generated/source.dart'; | 9 import 'package:analyzer/src/generated/source.dart'; |
| 10 import 'package:analyzer/src/summary/flat_buffers.dart' as fb; | 10 import 'package:analyzer/src/summary/flat_buffers.dart' as fb; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 _BuilderOutput strong = new _Builder(sdkPath, true).build(); | 126 _BuilderOutput strong = new _Builder(sdkPath, true).build(); |
| 127 return new _Output(spec, strong); | 127 return new _Output(spec, strong); |
| 128 } | 128 } |
| 129 | 129 |
| 130 /** | 130 /** |
| 131 * Open the flat buffer in [inputPath] and extract the byte array in the [field] | 131 * Open the flat buffer in [inputPath] and extract the byte array in the [field] |
| 132 * into the [outputPath] file. | 132 * into the [outputPath] file. |
| 133 */ | 133 */ |
| 134 void _extractSingleOutput(String inputPath, int field, String outputPath) { | 134 void _extractSingleOutput(String inputPath, int field, String outputPath) { |
| 135 List<int> bytes = new File(inputPath).readAsBytesSync(); | 135 List<int> bytes = new File(inputPath).readAsBytesSync(); |
| 136 fb.BufferPointer bp = new fb.BufferPointer.fromBytes(bytes); | 136 fb.BufferPointer root = new fb.BufferPointer.fromBytes(bytes); |
| 137 fb.BufferPointer table = bp.derefObject(); | 137 fb.BufferPointer table = root.derefObject(); |
| 138 List<int> fieldBytes = | 138 List<int> fieldBytes = const fb.Uint8ListReader().vTableGet(table, field); |
| 139 const fb.ListReader(const fb.Uint8Reader()).vTableGet(table, field); | |
| 140 new File(outputPath).writeAsBytesSync(fieldBytes, mode: FileMode.WRITE_ONLY); | 139 new File(outputPath).writeAsBytesSync(fieldBytes, mode: FileMode.WRITE_ONLY); |
| 141 } | 140 } |
| 142 | 141 |
| 143 /** | 142 /** |
| 144 * Print information about how to use the SDK summaries builder. | 143 * Print information about how to use the SDK summaries builder. |
| 145 */ | 144 */ |
| 146 void _printUsage() { | 145 void _printUsage() { |
| 147 // print('Usage: $BINARY_NAME command output_directory_path [sdk_path]'); | 146 // print('Usage: $BINARY_NAME command output_directory_path [sdk_path]'); |
| 148 print('Usage: $BINARY_NAME command arguments'); | 147 print('Usage: $BINARY_NAME command arguments'); |
| 149 print('Where command can be one of the following:'); | 148 print('Where command can be one of the following:'); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 } | 254 } |
| 256 } | 255 } |
| 257 } | 256 } |
| 258 | 257 |
| 259 class _Output { | 258 class _Output { |
| 260 final _BuilderOutput spec; | 259 final _BuilderOutput spec; |
| 261 final _BuilderOutput strong; | 260 final _BuilderOutput strong; |
| 262 | 261 |
| 263 _Output(this.spec, this.strong); | 262 _Output(this.spec, this.strong); |
| 264 } | 263 } |
| OLD | NEW |