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

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

Issue 2598523003: cmdline flags override analysis options in file (Closed)
Patch Set: address comments Created 4 years 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/lib/src/command_line/arguments.dart ('k') | pkg/analyzer/lib/src/task/options.dart » ('j') | 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 95b94651b31d37cec9e7b618a2aedf2742ea854d..aad53cfdde47479da00382605de164cd7c689fcc 100644
--- a/pkg/analyzer/lib/src/context/builder.dart
+++ b/pkg/analyzer/lib/src/context/builder.dart
@@ -12,6 +12,8 @@ import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/plugin/resolver_provider.dart';
import 'package:analyzer/source/analysis_options_provider.dart';
import 'package:analyzer/source/package_map_resolver.dart';
+import 'package:analyzer/src/command_line/arguments.dart'
+ show applyAnalysisOptionFlags;
import 'package:analyzer/src/dart/sdk/sdk.dart';
import 'package:analyzer/src/generated/bazel.dart';
import 'package:analyzer/src/generated/engine.dart';
@@ -21,6 +23,7 @@ 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:args/args.dart';
import 'package:package_config/packages.dart';
import 'package:package_config/packages_file.dart';
import 'package:package_config/src/packages_impl.dart';
@@ -349,6 +352,9 @@ class ContextBuilder {
} catch (_) {
// Ignore exceptions thrown while trying to load the options file.
}
+ if (builderOptions.argResults != null) {
+ applyAnalysisOptionFlags(options, builderOptions.argResults);
+ }
}
return options;
}
@@ -481,6 +487,12 @@ class ContextBuilder {
*/
class ContextBuilderOptions {
/**
+ * The results of parsing the command line arguments as defined by
+ * [defineAnalysisArguments] or `null` if none.
+ */
+ ArgResults argResults;
+
+ /**
* 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'.
« no previous file with comments | « pkg/analyzer/lib/src/command_line/arguments.dart ('k') | pkg/analyzer/lib/src/task/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698