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

Unified Diff: pkg/analyzer_cli/lib/src/driver.dart

Issue 1828903002: Fix for analyze-cli and Dart SDK options. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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_cli/lib/src/driver.dart
diff --git a/pkg/analyzer_cli/lib/src/driver.dart b/pkg/analyzer_cli/lib/src/driver.dart
index a4c2535d5a3a55881dad318e3e30a884d74174fa..070d06821fbfc2adee3da1eef04afe27dc1df162 100644
--- a/pkg/analyzer_cli/lib/src/driver.dart
+++ b/pkg/analyzer_cli/lib/src/driver.dart
@@ -588,10 +588,26 @@ class Driver implements CommandLineStarter {
// to activate batch mode.
if (sdk == null) {
sdk = new DirectoryBasedDartSdk(new JavaFile(options.dartSdkPath));
+ sdk.analysisOptions = createAnalysisOptionsForCommandLineOptions(options);
}
_isBatch = options.shouldBatch;
}
+ static AnalysisOptionsImpl createAnalysisOptionsForCommandLineOptions(
+ CommandLineOptions options) {
+ AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl();
+ contextOptions.hint = !options.disableHints;
+ contextOptions.enableStrictCallChecks = options.enableStrictCallChecks;
+ contextOptions.enableSuperMixins = options.enableSuperMixins;
+ contextOptions.enableConditionalDirectives =
+ options.enableConditionalDirectives;
+ contextOptions.generateImplicitErrors = options.showPackageWarnings;
+ contextOptions.generateSdkErrors = options.showSdkWarnings;
+ contextOptions.lint = options.lints;
+ contextOptions.strongMode = options.strongMode;
+ return contextOptions;
+ }
+
static void setAnalysisContextOptions(
AnalysisContext context,
CommandLineOptions options,
@@ -609,21 +625,12 @@ class Driver implements CommandLineStarter {
}
// Prepare context options.
- AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl();
- contextOptions.hint = !options.disableHints;
- contextOptions.enableStrictCallChecks = options.enableStrictCallChecks;
- contextOptions.enableSuperMixins = options.enableSuperMixins;
- contextOptions.enableConditionalDirectives =
- options.enableConditionalDirectives;
- contextOptions.generateImplicitErrors = options.showPackageWarnings;
- contextOptions.generateSdkErrors = options.showSdkWarnings;
- contextOptions.lint = options.lints;
- contextOptions.strongMode = options.strongMode;
+ AnalysisOptionsImpl contextOptions =
+ createAnalysisOptionsForCommandLineOptions(options);
configureContextOptions(contextOptions);
// Set context options.
context.analysisOptions = contextOptions;
- context.sourceFactory.dartSdk.context.analysisOptions = contextOptions;
// Process analysis options file (and notify all interested parties).
_processAnalysisOptions(context, options);
« 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