Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(793)

Unified Diff: pkg/analyzer/tool/summary/build_sdk_summary.dart

Issue 1672753002: Generate spec.sum and strong.sum summaties for SDK. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Use the word 'build' instead of 'generate'. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/tool/summary/build_sdk_summaries.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/tool/summary/build_sdk_summary.dart
diff --git a/pkg/analyzer/tool/summary/build_sdk_summary.dart b/pkg/analyzer/tool/summary/build_sdk_summary.dart
deleted file mode 100644
index 624db692893b2ed01977e64442985195e2c3be92..0000000000000000000000000000000000000000
--- a/pkg/analyzer/tool/summary/build_sdk_summary.dart
+++ /dev/null
@@ -1,90 +0,0 @@
-import 'dart:io';
-
-import 'package:analyzer/dart/element/element.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/java_io.dart';
-import 'package:analyzer/src/generated/sdk.dart';
-import 'package:analyzer/src/generated/sdk_io.dart';
-import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/summary/format.dart';
-import 'package:analyzer/src/summary/summarize_elements.dart';
-
-main(List<String> args) {
- if (args.length < 1 || args.length > 2) {
- _printUsage();
- exitCode = 1;
- return;
- }
- //
- // Prepare output file path.
- //
- String outputFilePath = args[0];
- if (FileSystemEntity.isDirectorySync(outputFilePath)) {
- print("'$outputFilePath' is a directory.");
- _printUsage();
- exitCode = 1;
- return;
- }
- //
- // Prepare SDK path.
- //
- String sdkPath;
- if (args.length == 2) {
- sdkPath = args[1];
- if (!FileSystemEntity.isDirectorySync('$sdkPath/lib')) {
- print("'$sdkPath/lib' does not exist.");
- _printUsage();
- exitCode = 1;
- return;
- }
- } else {
- sdkPath = DirectoryBasedDartSdk.defaultSdkDirectory.getAbsolutePath();
- }
- //
- // Prepare SDK.
- //
- DirectoryBasedDartSdk sdk = new DirectoryBasedDartSdk(new JavaFile(sdkPath));
- AnalysisContext context = sdk.context;
- //
- // Serialize each SDK library.
- //
- List<String> linkedLibraryUris = <String>[];
- List<LinkedLibraryBuilder> linkedLibraries = <LinkedLibraryBuilder>[];
- List<String> unlinkedUnitUris = <String>[];
- List<UnlinkedUnitBuilder> unlinkedUnits = <UnlinkedUnitBuilder>[];
- for (SdkLibrary lib in sdk.sdkLibraries) {
- print('Resolving and serializing: ${lib.shortName}');
- Source librarySource = sdk.mapDartUri(lib.shortName);
- LibraryElement libraryElement =
- context.computeLibraryElement(librarySource);
- // TODO(paulberry): also build a summary of the SDK in strong mode.
- LibrarySerializationResult libraryResult =
- serializeLibrary(libraryElement, context.typeProvider, false);
- linkedLibraryUris.add(lib.shortName);
- linkedLibraries.add(libraryResult.linked);
- unlinkedUnitUris.addAll(libraryResult.unitUris);
- unlinkedUnits.addAll(libraryResult.unlinkedUnits);
- }
- //
- // Write the whole SDK bundle.
- //
- SdkBundleBuilder sdkBundle = new SdkBundleBuilder(
- linkedLibraryUris: linkedLibraryUris,
- linkedLibraries: linkedLibraries,
- unlinkedUnitUris: unlinkedUnitUris,
- unlinkedUnits: unlinkedUnits);
- File file = new File(outputFilePath);
- file.writeAsBytesSync(sdkBundle.toBuffer(), mode: FileMode.WRITE_ONLY);
-}
-
-/**
- * The name of the SDK summary builder application.
- */
-const BINARY_NAME = "build_sdk_summary";
-
-/**
- * Print information about how to use the SDK summary builder.
- */
-void _printUsage() {
- print('Usage: $BINARY_NAME output_file_path [sdk_path]');
-}
« no previous file with comments | « pkg/analyzer/tool/summary/build_sdk_summaries.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698