mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:17:55 +00:00
Revert "Revert "Reapply "Switch to the new analysis driver in analyzer_cli."""
This reverts commit64df435361
. Originally landed ascda7520e5c
No new changes. R=brianwilkerson@google.com BUG= Review-Url: https://codereview.chromium.org/2698263002 .
This commit is contained in:
parent
364b8575de
commit
b7f17423da
|
@ -266,8 +266,9 @@ class AnalyzerImpl {
|
|||
if (analysisDriver != null) {
|
||||
String path = librarySource.fullName;
|
||||
analysisDriver.priorityFiles = [path];
|
||||
AnalysisResult analysisResult = await analysisDriver.getResult(path);
|
||||
return analysisResult.unit.element.library;
|
||||
UnitElementResult elementResult =
|
||||
await analysisDriver.getUnitElement(path);
|
||||
return elementResult.element.library;
|
||||
} else {
|
||||
return context.computeLibraryElement(librarySource);
|
||||
}
|
||||
|
|
|
@ -581,7 +581,9 @@ class Driver implements CommandLineStarter {
|
|||
scheduler,
|
||||
log,
|
||||
resourceProvider,
|
||||
analysisDriverMemoryByteStore,
|
||||
options.useAnalysisDriverMemoryByteStore
|
||||
? analysisDriverMemoryByteStore
|
||||
: analysisDriverFileByteStore,
|
||||
new FileContentOverlay(),
|
||||
'test',
|
||||
context.sourceFactory,
|
||||
|
|
|
@ -33,7 +33,7 @@ typedef void ExitHandler(int code);
|
|||
|
||||
/// Analyzer commandline configuration options.
|
||||
class CommandLineOptions {
|
||||
final bool enableNewAnalysisDriver = false;
|
||||
final bool enableNewAnalysisDriver = true;
|
||||
|
||||
/// The path to output analysis results when in build mode.
|
||||
final String buildAnalysisOutput;
|
||||
|
@ -143,6 +143,9 @@ class CommandLineOptions {
|
|||
/// Whether to treat lints as fatal
|
||||
final bool lintsAreFatal;
|
||||
|
||||
/// Whether to use memory byte store for analysis driver.
|
||||
final bool useAnalysisDriverMemoryByteStore;
|
||||
|
||||
/// Initialize options from the given parsed [args].
|
||||
CommandLineOptions._fromArgs(ArgResults args)
|
||||
: buildAnalysisOutput = args['build-analysis-output'],
|
||||
|
@ -181,7 +184,9 @@ class CommandLineOptions {
|
|||
strongMode = args['strong'],
|
||||
implicitCasts = !args['no-implicit-casts'],
|
||||
implicitDynamic = !args['no-implicit-dynamic'],
|
||||
lintsAreFatal = args['fatal-lints'];
|
||||
lintsAreFatal = args['fatal-lints'],
|
||||
useAnalysisDriverMemoryByteStore =
|
||||
args['use-analysis-driver-memory-byte-store'];
|
||||
|
||||
/// The path to an analysis options file
|
||||
String get analysisOptionsFile =>
|
||||
|
@ -453,6 +458,11 @@ class CommandLineOptions {
|
|||
help: 'Check types in constant evaluation.',
|
||||
defaultsTo: false,
|
||||
negatable: false,
|
||||
hide: hide)
|
||||
..addFlag('use-analysis-driver-memory-byte-store',
|
||||
help: 'Use memory byte store, not the file system cache.',
|
||||
defaultsTo: false,
|
||||
negatable: false,
|
||||
hide: hide);
|
||||
|
||||
try {
|
||||
|
|
|
@ -45,4 +45,6 @@ DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
|
|||
|
||||
ANALYZER="$DART_ROOT/pkg/analyzer_cli/bin/analyzer.dart"
|
||||
|
||||
exec "$DART" "--packages=$DART_ROOT/.packages" "${EXTRA_VM_OPTIONS[@]}" "$ANALYZER" "$SDK_ARG" "$@"
|
||||
DEV_OPTIONS="--use-analysis-driver-memory-byte-store"
|
||||
|
||||
exec "$DART" "--packages=$DART_ROOT/.packages" "${EXTRA_VM_OPTIONS[@]}" "$ANALYZER" "$DEV_OPTIONS" "$SDK_ARG" "$@"
|
||||
|
|
Loading…
Reference in a new issue