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

Unified Diff: pkg/analyzer/lib/src/command_line/arguments.dart

Issue 2598593003: support --options flag and other analysis options flags in DDC (Closed)
Patch Set: merge Created 3 years, 11 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 | pkg/dev_compiler/lib/src/analyzer/context.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/command_line/arguments.dart
diff --git a/pkg/analyzer/lib/src/command_line/arguments.dart b/pkg/analyzer/lib/src/command_line/arguments.dart
index 22a967065beb68a673e0f35ed641b52f78a418d9..1871625373c9117e13f294fc0466cf69c44d6665 100644
--- a/pkg/analyzer/lib/src/command_line/arguments.dart
+++ b/pkg/analyzer/lib/src/command_line/arguments.dart
@@ -53,7 +53,8 @@ void applyAnalysisOptionFlags(AnalysisOptionsImpl options, ArgResults args) {
* Use the given [resourceProvider], [contentCache] and command-line [args] to
* create a context builder.
*/
-ContextBuilderOptions createContextBuilderOptions(ArgResults args) {
+ContextBuilderOptions createContextBuilderOptions(ArgResults args,
+ {bool strongMode, bool trackCacheDependencies}) {
ContextBuilderOptions builderOptions = new ContextBuilderOptions();
builderOptions.argResults = args;
//
@@ -69,6 +70,12 @@ ContextBuilderOptions createContextBuilderOptions(ArgResults args) {
//
AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
applyAnalysisOptionFlags(defaultOptions, args);
+ if (strongMode != null) {
+ defaultOptions.strongMode = strongMode;
+ }
+ if (trackCacheDependencies != null) {
+ defaultOptions.trackCacheDependencies = trackCacheDependencies;
+ }
builderOptions.defaultOptions = defaultOptions;
//
// Declared variables.
@@ -137,7 +144,7 @@ void defineAnalysisArguments(ArgParser parser, {bool hide: true, ddc: false}) {
help: 'The path to the Dart SDK summary file.', hide: hide);
parser.addOption(analysisOptionsFileOption,
- help: 'Path to an analysis options file.', hide: ddc);
+ help: 'Path to an analysis options file.');
parser.addOption(packageRootOption,
abbr: 'p',
@@ -151,16 +158,13 @@ void defineAnalysisArguments(ArgParser parser, {bool hide: true, ddc: false}) {
parser.addFlag(strongModeFlag,
help: 'Enable strong static checks (https://goo.gl/DqcBsw)',
- defaultsTo: ddc,
- hide: ddc);
+ defaultsTo: ddc);
parser.addFlag(noImplicitCastsFlag,
negatable: false,
- help: 'Disable implicit casts in strong mode (https://goo.gl/cTLz40)',
- hide: ddc);
+ help: 'Disable implicit casts in strong mode (https://goo.gl/cTLz40)');
parser.addFlag(noImplicitDynamicFlag,
negatable: false,
- help: 'Disable implicit dynamic (https://goo.gl/m0UgXD)',
- hide: ddc);
+ help: 'Disable implicit dynamic (https://goo.gl/m0UgXD)');
//
// Hidden flags and options.
//
@@ -173,7 +177,7 @@ void defineAnalysisArguments(ArgParser parser, {bool hide: true, ddc: false}) {
help: 'Fix issue 21938.',
defaultsTo: false,
negatable: false,
- hide: hide || ddc);
+ hide: hide);
parser.addFlag(enableInitializingFormalAccessFlag,
help:
'Enable support for allowing access to field formal parameters in a '
@@ -185,7 +189,7 @@ void defineAnalysisArguments(ArgParser parser, {bool hide: true, ddc: false}) {
help: 'Relax restrictions on mixins (DEP 34).',
defaultsTo: false,
negatable: false,
- hide: hide || ddc);
+ hide: hide);
// parser.addFlag('enable_type_checks',
// help: 'Check types in constant evaluation.',
// defaultsTo: false,
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/src/analyzer/context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698