| OLD | NEW |
| 1 import 'dart:io'; | 1 import 'dart:io'; |
| 2 | 2 |
| 3 import 'package:analyzer/dart/element/element.dart'; | 3 import 'package:analyzer/dart/element/element.dart'; |
| 4 import 'package:analyzer/src/generated/engine.dart'; | 4 import 'package:analyzer/src/generated/engine.dart'; |
| 5 import 'package:analyzer/src/generated/java_io.dart'; | 5 import 'package:analyzer/src/generated/java_io.dart'; |
| 6 import 'package:analyzer/src/generated/sdk.dart'; | 6 import 'package:analyzer/src/generated/sdk.dart'; |
| 7 import 'package:analyzer/src/generated/sdk_io.dart'; | 7 import 'package:analyzer/src/generated/sdk_io.dart'; |
| 8 import 'package:analyzer/src/generated/source.dart'; | 8 import 'package:analyzer/src/generated/source.dart'; |
| 9 import 'package:analyzer/src/summary/format.dart'; | 9 import 'package:analyzer/src/summary/format.dart'; |
| 10 import 'package:analyzer/src/summary/summarize_elements.dart'; | 10 import 'package:analyzer/src/summary/summarize_elements.dart'; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 LibrarySerializationResult libraryResult = | 58 LibrarySerializationResult libraryResult = |
| 59 serializeLibrary(libraryElement, context.typeProvider); | 59 serializeLibrary(libraryElement, context.typeProvider); |
| 60 prelinkedLibraryUris.add(lib.shortName); | 60 prelinkedLibraryUris.add(lib.shortName); |
| 61 prelinkedLibraries.add(libraryResult.prelinked); | 61 prelinkedLibraries.add(libraryResult.prelinked); |
| 62 unlinkedUnitUris.addAll(libraryResult.unitUris); | 62 unlinkedUnitUris.addAll(libraryResult.unitUris); |
| 63 unlinkedUnits.addAll(libraryResult.unlinkedUnits); | 63 unlinkedUnits.addAll(libraryResult.unlinkedUnits); |
| 64 } | 64 } |
| 65 // | 65 // |
| 66 // Write the whole SDK bundle. | 66 // Write the whole SDK bundle. |
| 67 // | 67 // |
| 68 SdkBundleBuilder sdkBundle = encodeSdkBundle( | 68 SdkBundleBuilder sdkBundle = new SdkBundleBuilder( |
| 69 prelinkedLibraryUris: prelinkedLibraryUris, | 69 prelinkedLibraryUris: prelinkedLibraryUris, |
| 70 prelinkedLibraries: prelinkedLibraries, | 70 prelinkedLibraries: prelinkedLibraries, |
| 71 unlinkedUnitUris: unlinkedUnitUris, | 71 unlinkedUnitUris: unlinkedUnitUris, |
| 72 unlinkedUnits: unlinkedUnits); | 72 unlinkedUnits: unlinkedUnits); |
| 73 File file = new File(outputFilePath); | 73 File file = new File(outputFilePath); |
| 74 file.writeAsBytesSync(sdkBundle.toBuffer(), mode: FileMode.WRITE_ONLY); | 74 file.writeAsBytesSync(sdkBundle.toBuffer(), mode: FileMode.WRITE_ONLY); |
| 75 } | 75 } |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * The name of the SDK summary builder application. | 78 * The name of the SDK summary builder application. |
| 79 */ | 79 */ |
| 80 const BINARY_NAME = "build_sdk_summary"; | 80 const BINARY_NAME = "build_sdk_summary"; |
| 81 | 81 |
| 82 /** | 82 /** |
| 83 * Print information about how to use the SDK summary builder. | 83 * Print information about how to use the SDK summary builder. |
| 84 */ | 84 */ |
| 85 void _printUsage() { | 85 void _printUsage() { |
| 86 print('Usage: $BINARY_NAME output_file_path [sdk_path]'); | 86 print('Usage: $BINARY_NAME output_file_path [sdk_path]'); |
| 87 } | 87 } |
| OLD | NEW |