SummaryGenerator class

Generates analyzer summaries for packages.

Creates binary .sum files containing pre-analyzed type information for stable dependencies (hosted and SDK packages). These summaries can be loaded by the analyzer to skip re-analysis of unchanged packages.

Usage

final cacheManager = SummaryCacheManager('/path/to/workspace');
final depResolver = DependencyResolver();
final generator = SummaryGenerator(
  cacheManager: cacheManager,
  dependencyResolver: depResolver,
);

// Generate summaries for all missing dependencies
final deps = await depResolver.resolveCacheableDependencies('/path/to/project');
final result = await generator.generateMissingSummaries(deps);
print('Generated ${result.generated} summaries');

Constructors

SummaryGenerator({required SummaryCacheManager cacheManager, required DependencyResolver dependencyResolver})
Creates a summary generator.

Properties

cacheManager SummaryCacheManager
The cache manager for reading/writing summary files.
final
dependencyResolver DependencyResolver
The dependency resolver for locating package sources.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildDirectDependencyGraph(List<PackageDependency> dependencies) Future<Map<String, Set<String>>>
Builds the direct-dependency graph restricted to the cacheable set.
computeDependencyFingerprints(List<PackageDependency> dependencies, {Map<String, Set<String>>? directDependencyGraph}) Future<Map<String, String>>
Computes, for each cacheable package, a fingerprint of the exact versioned dependency closure its summary is linked against.
generateMissingSummaries(List<PackageDependency> dependencies, {String? sdkSummaryPath, void onProgress(String package, int current, int total)?}) Future<SummaryGenerationResult>
Generates summaries for all dependencies that are missing from the cache.
generateSdkSummary() Future<bool>
Generates the Dart SDK summary and stores it in the cache.
generateSummary(PackageDependency dependency, {String? sdkSummaryPath, List<String>? librarySummaryPaths}) Future<bool>
Generates a summary for a single package.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

dependentsClosure(Map<String, Set<String>> directDeps, Iterable<String> seeds) Set<String>
Expands seeds to include every package that transitively depends on any seed, following the reverse of directDeps.