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

Unified Diff: pkg/analyzer/lib/src/context/builder.dart

Issue 2416243003: Add more summary support to ContextBuilder (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/builder.dart
diff --git a/pkg/analyzer/lib/src/context/builder.dart b/pkg/analyzer/lib/src/context/builder.dart
index bef683755c50a92f0f14603f15afc7f882a96a75..882094f350c37e6594bd3fba4aaeff45235ee842 100644
--- a/pkg/analyzer/lib/src/context/builder.dart
+++ b/pkg/analyzer/lib/src/context/builder.dart
@@ -20,6 +20,7 @@ import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/summary/package_bundle_reader.dart';
import 'package:analyzer/src/summary/pub_summary.dart';
+import 'package:analyzer/src/summary/summary_sdk.dart';
import 'package:analyzer/src/task/options.dart';
import 'package:package_config/packages.dart';
import 'package:package_config/packages_file.dart';
@@ -96,6 +97,13 @@ class ContextBuilder {
String defaultPackagesDirectoryPath;
/**
+ * The file path of the file containing the summary of the SDK that should be
+ * used to "analyze" the SDK. This option should only be specified by
+ * command-line tools such as 'dartanalyzer' or 'ddc'.
+ */
+ String dartSdkSummaryPath;
+
+ /**
* The file path of the analysis options file that should be used in place of
* any file in the root directory or a parent of the root directory, or `null`
* if the normal lookup mechanism should be used.
@@ -288,7 +296,9 @@ class ContextBuilder {
*/
DartSdk findSdk(
Map<String, List<Folder>> packageMap, AnalysisOptions options) {
- if (packageMap != null) {
+ if (dartSdkSummaryPath != null) {
+ return new SummaryBasedDartSdk(dartSdkSummaryPath, options.strongMode);
+ } else if (packageMap != null) {
SdkExtensionFinder extFinder = new SdkExtensionFinder(packageMap);
List<String> extFilePaths = extFinder.extensionFilePaths;
EmbedderYamlLocator locator = new EmbedderYamlLocator(packageMap);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698