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

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

Issue 2474523003: fix #27607, add dev_compiler summary to the SDK and move JS files (Closed)
Patch Set: fix typo Created 4 years, 1 month 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/dev_compiler/lib/sdk/ddc_sdk.sum ('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 05bacf9c3f7546e2fa7a75b656d7df2b56ea164c..209c2fe386ee0b1f97d908a5e52548781c70c094 100644
--- a/pkg/dev_compiler/lib/src/analyzer/context.dart
+++ b/pkg/dev_compiler/lib/src/analyzer/context.dart
@@ -55,13 +55,25 @@ class AnalyzerOptions {
this.packagePaths: const []})
: dartSdkPath = dartSdkPath ?? getSdkDir().path;
- AnalyzerOptions.fromArguments(ArgResults args)
- : summaryPaths = args['summary'] as List<String>,
- dartSdkPath = args['dart-sdk'] ?? getSdkDir().path,
- dartSdkSummaryPath = args['dart-sdk-summary'],
- customUrlMappings = _parseUrlMappings(args['url-mapping']),
- packageRoot = args['package-root'],
- packagePaths = (args['package-paths'] as String)?.split(',') ?? [];
+ factory AnalyzerOptions.fromArguments(ArgResults args) {
+ var sdkPath = args['dart-sdk'] ?? getSdkDir().path;
+ var sdkSummaryPath = args['dart-sdk-summary'];
+
+ if (sdkSummaryPath == null) {
+ sdkSummaryPath = path.join(sdkPath, 'lib', '_internal', 'ddc_sdk.sum');
+ } else if (sdkSummaryPath == 'build') {
+ // For building the SDK, we explicitly set the path to none.
+ sdkSummaryPath = null;
+ }
+
+ return new AnalyzerOptions(
+ summaryPaths: args['summary'] as List<String>,
+ dartSdkPath: sdkPath,
+ dartSdkSummaryPath: sdkSummaryPath,
+ customUrlMappings: _parseUrlMappings(args['url-mapping']),
+ packageRoot: args['package-root'],
+ packagePaths: (args['package-paths'] as String)?.split(',') ?? []);
+ }
/// Whether to resolve 'package:' uris using the multi-package resolver.
bool get useMultiPackage => packagePaths.isNotEmpty;
@@ -70,9 +82,10 @@ class AnalyzerOptions {
parser
..addOption('summary',
abbr: 's', help: 'summary file(s) to include', allowMultiple: true)
- ..addOption('dart-sdk', help: 'Dart SDK Path', defaultsTo: null)
+ ..addOption('dart-sdk',
+ help: 'Dart SDK Path', defaultsTo: null, hide: true)
..addOption('dart-sdk-summary',
- help: 'Dart SDK Summary Path', defaultsTo: null)
+ help: 'Dart SDK Summary Path', defaultsTo: null, hide: true)
..addOption('package-root',
abbr: 'p', help: 'Package root to resolve "package:" imports')
..addOption('url-mapping',
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/lib/src/compiler/command.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698