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

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

Issue 2994763002: Switch build mode to Analysis Driver. (Closed)
Patch Set: Created 3 years, 4 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 | « pkg/analyzer_cli/lib/src/build_mode.dart ('k') | pkg/analyzer_cli/test/build_mode_test.dart » ('j') | 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 8efdc2e10ecb448c4e5ce5691529270130a79f01..e993f1c10f1427a9a56b9f5cf0432f33fb35f630 100644
--- a/pkg/analyzer_cli/lib/src/driver.dart
+++ b/pkg/analyzer_cli/lib/src/driver.dart
@@ -180,7 +180,7 @@ class Driver implements CommandLineStarter {
// Do analysis.
if (options.buildMode) {
- ErrorSeverity severity = _buildModeAnalyze(options);
+ ErrorSeverity severity = await _buildModeAnalyze(options);
// Propagate issues to the exit code.
if (_shouldBeFatal(severity, options)) {
io.exitCode = severity.ordinal;
@@ -365,16 +365,20 @@ class Driver implements CommandLineStarter {
}
/// Perform analysis in build mode according to the given [options].
- ErrorSeverity _buildModeAnalyze(CommandLineOptions options) {
- return _analyzeAllTag.makeCurrentWhile(() {
+ Future<ErrorSeverity> _buildModeAnalyze(CommandLineOptions options) async {
+ PerformanceTag previous = _analyzeAllTag.makeCurrent();
+ try {
if (options.buildModePersistentWorker) {
- new AnalyzerWorkerLoop.std(resourceProvider,
+ await new AnalyzerWorkerLoop.std(resourceProvider,
dartSdkPath: options.dartSdkPath)
.run();
+ return ErrorSeverity.NONE;
} else {
- return new BuildMode(resourceProvider, options, stats).analyze();
+ return await new BuildMode(resourceProvider, options, stats).analyze();
}
- });
+ } finally {
+ previous.makeCurrent();
+ }
}
/// Decide on the appropriate policy for which files need to be fully parsed
« no previous file with comments | « pkg/analyzer_cli/lib/src/build_mode.dart ('k') | pkg/analyzer_cli/test/build_mode_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698