When analyzer_cli is given --preview-dart-2, use KernelDriver.

R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I91484f906a691fba80917f8fd8ec1c0628c0815f
Reviewed-on: https://dart-review.googlesource.com/14505
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Konstantin Shcheglov 2017-10-17 18:10:04 +00:00
parent abefb7b432
commit 7d28e6fc21
2 changed files with 4 additions and 1 deletions

View file

@ -148,8 +148,10 @@ class KernelContext {
}
if (DEBUG) {
print('----------- ${targetLibrary.uriStr}');
var libraryKernel = libraryMap[targetLibrary.uriStr];
print(_getLibraryText(libraryKernel));
print('--------------------------------------');
}
// Create and configure a new context.

View file

@ -650,7 +650,8 @@ class Driver implements CommandLineStarter {
new FileContentOverlay(),
null,
context.sourceFactory,
context.analysisOptions);
context.analysisOptions,
enableKernelDriver: options.previewDart2);
analysisDriver.results.listen((_) {});
analysisDriver.exceptions.listen((_) {});
scheduler.start();