OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer_cli.src.build_mode; | 5 library analyzer_cli.src.build_mode; |
6 | 6 |
7 import 'dart:core' hide Resource; | 7 import 'dart:core' hide Resource; |
8 import 'dart:io' as io; | 8 import 'dart:io' as io; |
9 | 9 |
10 import 'package:analyzer/dart/ast/ast.dart' show CompilationUnit; | 10 import 'package:analyzer/dart/ast/ast.dart' show CompilationUnit; |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 SyncWorkerConnection connection = new StdSyncWorkerConnection( | 290 SyncWorkerConnection connection = new StdSyncWorkerConnection( |
291 stdinStream: stdinStream, stdoutStream: stdoutStream); | 291 stdinStream: stdinStream, stdoutStream: stdoutStream); |
292 return new AnalyzerWorkerLoop(connection, dartSdkPath: dartSdkPath); | 292 return new AnalyzerWorkerLoop(connection, dartSdkPath: dartSdkPath); |
293 } | 293 } |
294 | 294 |
295 /** | 295 /** |
296 * Performs analysis with given [options]. | 296 * Performs analysis with given [options]. |
297 */ | 297 */ |
298 void analyze(CommandLineOptions options) { | 298 void analyze(CommandLineOptions options) { |
299 new BuildMode(options, new AnalysisStats()).analyze(); | 299 new BuildMode(options, new AnalysisStats()).analyze(); |
| 300 AnalysisEngine.instance.clearCaches(); |
300 } | 301 } |
301 | 302 |
302 /** | 303 /** |
303 * Perform a single loop step. | 304 * Perform a single loop step. |
304 */ | 305 */ |
305 WorkResponse performRequest(WorkRequest request) { | 306 WorkResponse performRequest(WorkRequest request) { |
306 errorBuffer.clear(); | 307 errorBuffer.clear(); |
307 outBuffer.clear(); | 308 outBuffer.clear(); |
308 try { | 309 try { |
309 // Add in the dart-sdk argument if `dartSdkPath` is not null, otherwise it | 310 // Add in the dart-sdk argument if `dartSdkPath` is not null, otherwise it |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 String msg = ''; | 351 String msg = ''; |
351 if (errorBuffer.isNotEmpty) { | 352 if (errorBuffer.isNotEmpty) { |
352 msg += errorBuffer.toString() + '\n'; | 353 msg += errorBuffer.toString() + '\n'; |
353 } | 354 } |
354 if (outBuffer.isNotEmpty) { | 355 if (outBuffer.isNotEmpty) { |
355 msg += outBuffer.toString() + '\n'; | 356 msg += outBuffer.toString() + '\n'; |
356 } | 357 } |
357 return msg; | 358 return msg; |
358 } | 359 } |
359 } | 360 } |
OLD | NEW |