Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Unified Diff: pkg/analyzer_cli/lib/src/driver.dart

Issue 2694083002: Switch to the new analysis driver in analyzer_cli. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer_cli/lib/src/analyzer_impl.dart ('k') | pkg/analyzer_cli/lib/src/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « pkg/analyzer_cli/lib/src/analyzer_impl.dart ('k') | pkg/analyzer_cli/lib/src/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698