| 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 e91d07ef262d6373d7af382528fca49a2114cbd7..b2116abccb966e84d7577d09dc5f43ea145ee7b1 100644
|
| --- a/pkg/analyzer_cli/lib/src/driver.dart
|
| +++ b/pkg/analyzer_cli/lib/src/driver.dart
|
| @@ -21,6 +21,7 @@ import 'package:analyzer/source/sdk_ext.dart';
|
| import 'package:analyzer/src/context/builder.dart';
|
| import 'package:analyzer/src/dart/analysis/byte_store.dart';
|
| import 'package:analyzer/src/dart/analysis/driver.dart';
|
| +import 'package:analyzer/src/dart/analysis/file_byte_store.dart';
|
| import 'package:analyzer/src/dart/analysis/file_state.dart';
|
| import 'package:analyzer/src/dart/sdk/sdk.dart';
|
| import 'package:analyzer/src/generated/constant.dart';
|
| @@ -76,7 +77,14 @@ class Driver implements CommandLineStarter {
|
| static final PerformanceTag _analyzeAllTag =
|
| new PerformanceTag("Driver._analyzeAll");
|
|
|
| - static ByteStore analysisDriverByteStore = new MemoryByteStore();
|
| + static ByteStore analysisDriverMemoryByteStore = new MemoryByteStore();
|
| + static ByteStore analysisDriverFileByteStore = new MemoryCachingByteStore(
|
| + new EvictingFileByteStore(
|
| + PhysicalResourceProvider.INSTANCE
|
| + .getStateLocation('.analysis-driver')
|
| + .path,
|
| + 1024 * 1024 * 1024 /*1 GiB*/),
|
| + 64 * 1024 * 1024 /*64 MiB*/);
|
|
|
| /// The plugins that are defined outside the `analyzer_cli` package.
|
| List<Plugin> _userDefinedPlugins = <Plugin>[];
|
| @@ -572,7 +580,9 @@ class Driver implements CommandLineStarter {
|
| scheduler,
|
| log,
|
| resourceProvider,
|
| - analysisDriverByteStore,
|
| + options.useAnalysisDriverMemoryByteStore
|
| + ? analysisDriverMemoryByteStore
|
| + : analysisDriverFileByteStore,
|
| new FileContentOverlay(),
|
| 'test',
|
| context.sourceFactory,
|
| @@ -716,6 +726,20 @@ class Driver implements CommandLineStarter {
|
| }
|
| }
|
|
|
| + static AnalysisOptionsImpl createAnalysisOptions(
|
| + file_system.ResourceProvider resourceProvider,
|
| + SourceFactory sourceFactory,
|
| + CommandLineOptions options) {
|
| + // Prepare context options.
|
| + AnalysisOptionsImpl analysisOptions =
|
| + createAnalysisOptionsForCommandLineOptions(options);
|
| +
|
| + // Process analysis options file (and notify all interested parties).
|
| + _processAnalysisOptions(
|
| + resourceProvider, sourceFactory, analysisOptions, options);
|
| + return analysisOptions;
|
| + }
|
| +
|
| static AnalysisOptionsImpl createAnalysisOptionsForCommandLineOptions(
|
| CommandLineOptions options) {
|
| AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl();
|
| @@ -733,20 +757,6 @@ class Driver implements CommandLineStarter {
|
| return contextOptions;
|
| }
|
|
|
| - static AnalysisOptionsImpl createAnalysisOptions(
|
| - file_system.ResourceProvider resourceProvider,
|
| - SourceFactory sourceFactory,
|
| - CommandLineOptions options) {
|
| - // Prepare context options.
|
| - AnalysisOptionsImpl analysisOptions =
|
| - createAnalysisOptionsForCommandLineOptions(options);
|
| -
|
| - // Process analysis options file (and notify all interested parties).
|
| - _processAnalysisOptions(
|
| - resourceProvider, sourceFactory, analysisOptions, options);
|
| - return analysisOptions;
|
| - }
|
| -
|
| static void setAnalysisContextOptions(
|
| file_system.ResourceProvider resourceProvider,
|
| SourceFactory sourceFactory,
|
|
|