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

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

Issue 2955513002: Dynamically load packages for dartdevc tests in test.dart. (Closed)
Patch Set: Remove TODO that's TODONE. Created 3 years, 6 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 | « .travis.yml ('k') | pkg/dev_compiler/lib/src/compiler/command.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/analyzer/context.dart
diff --git a/pkg/dev_compiler/lib/src/analyzer/context.dart b/pkg/dev_compiler/lib/src/analyzer/context.dart
index 188f9787624ef985c855d269d392cc837e6adad8..496ae800fdf03883953792226e605b00ed04798b 100644
--- a/pkg/dev_compiler/lib/src/analyzer/context.dart
+++ b/pkg/dev_compiler/lib/src/analyzer/context.dart
@@ -32,6 +32,8 @@ class AnalyzerOptions {
/// List of summary file paths.
final List<String> summaryPaths;
+ final Map<String, String> customSummaryModules = {};
+
/// Path to the dart-sdk, or `null` if the path couldn't be determined.
final String dartSdkPath;
@@ -51,6 +53,7 @@ class AnalyzerOptions {
: dartSdkPath = dartSdkPath ?? getSdkDir().path,
summaryPaths = summaryPaths ?? const [] {
contextBuilderOptions.declaredVariables ??= const {};
+ _parseCustomSummaryModules();
}
factory AnalyzerOptions.basic(
@@ -109,6 +112,24 @@ class AnalyzerOptions {
}
return mappings;
}
+
+ /// A summary path can contain ":" followed by an explicit module name to
+ /// allow working with summaries whose physical location is outside of the
+ /// module root directory.
+ ///
+ /// Removes any explicit module names from [summaryPaths] and populates with
+ /// [customSummaryModules] with them.
+ void _parseCustomSummaryModules() {
+ for (var i = 0; i < summaryPaths.length; i++) {
+ var summaryPath = summaryPaths[i];
+ var comma = summaryPath.indexOf(":");
+ if (comma != -1) {
+ summaryPaths[i] = summaryPath.substring(0, comma);
+ customSummaryModules[summaryPaths[i]] =
+ summaryPath.substring(comma + 1);
+ }
+ }
+ }
}
/// Creates a SourceFactory configured by the [options].
« no previous file with comments | « .travis.yml ('k') | pkg/dev_compiler/lib/src/compiler/command.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698