| 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 0c4f86d073d665ab0213fd718a289a4aa57a6366..f3c57a2ae99c0a6f00728150a8dd329cfffa696c 100644
|
| --- a/pkg/analyzer_cli/lib/src/driver.dart
|
| +++ b/pkg/analyzer_cli/lib/src/driver.dart
|
| @@ -78,13 +78,7 @@ class Driver implements CommandLineStarter {
|
| new PerformanceTag("Driver._analyzeAll");
|
|
|
| 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*/);
|
| + static ByteStore analysisDriverFileByteStore = _createFileByteStore();
|
|
|
| /// The plugins that are defined outside the `analyzer_cli` package.
|
| List<Plugin> _userDefinedPlugins = <Plugin>[];
|
| @@ -794,6 +788,22 @@ class Driver implements CommandLineStarter {
|
| context.analysisOptions = analysisOptions;
|
| }
|
|
|
| + /**
|
| + * If the state location can be accessed, return the file byte store,
|
| + * otherwise return the memory byte store.
|
| + */
|
| + static ByteStore _createFileByteStore() {
|
| + const int M = 1024 * 1024 /*1 MiB*/;
|
| + const int G = 1024 * 1024 * 1024 /*1 GiB*/;
|
| + file_system.Folder stateLocation =
|
| + PhysicalResourceProvider.INSTANCE.getStateLocation('.analysis-driver');
|
| + if (stateLocation == null) {
|
| + return new MemoryByteStore();
|
| + }
|
| + return new MemoryCachingByteStore(
|
| + new EvictingFileByteStore(stateLocation.path, G), 64 * M);
|
| + }
|
| +
|
| /// Perform a deep comparison of two string lists.
|
| static bool _equalLists(List<String> l1, List<String> l2) {
|
| if (l1.length != l2.length) {
|
|
|