tom_analyzer_shared library
Shared analyzer-summary caching infrastructure for Tom code generators.
This library exposes:
- PackageDependency / DependencySet — resolved dependency metadata.
- DependencyResolver — parses
pubspec.lockand locates hosted/SDK package source trees in the pub cache and the Flutter SDK. - SummaryCacheManager — reads and writes
.sumfiles under<workspace>/.tom/analyzer-cache/<analyzer-major>/. - analyzerMajorVersion — the analyzer major this build targets; used to partition the cache so analyzer upgrades cannot read stale bundles.
- SummaryGenerator — generates the SDK summary and per-package summaries in topological order.
- runSummaryCacheStage / SummaryCacheResult — a reusable orchestration entry-point for CLIs and builders.
- resolveDartSdkPath — robust Dart SDK location for AOT-compiled tools (where executable-relative SDK detection fails).
See the package README for motivation and examples.
Classes
- CacheStats
- Statistics about the summary cache.
- DependencyResolver
- Resolves project dependencies with their versions from pubspec.lock.
- DependencySet
- Groups dependencies by their cacheability status.
- PackageDependency
- Represents a resolved package dependency with version information.
- SummaryCacheManager
- Manages the analyzer summary cache for a workspace.
- SummaryCacheResult
- Result of a summary-cache stage execution.
- SummaryGenerationResult
- Result of generating summaries for a batch of packages.
- SummaryGenerator
- Generates analyzer summaries for packages.
Extensions
-
DependencyListExtensions
on List<
PackageDependency> - Extension methods for working with dependency lists.
Constants
- analyzerMajorVersion → const int
-
The major version of the
analyzerpackage this build oftom_analyzer_sharedwas compiled against.
Functions
-
looksLikeDartSdk(
String? dir) → bool -
Whether
dirlooks like a Dart SDK root. -
resolveDartSdkPath(
) → String? -
Resolves the Dart SDK root directory, or
nullto let the analyzer fall back to its default (executable-relative) detection. -
runSummaryCacheStage(
String projectRoot, {bool verbose = false, bool rebuildCache = false, bool showCacheStatus = false, List< String> cacheOnlyPackages = const [], void log(String message)?}) → Future<SummaryCacheResult?> - Runs the summary-cache stage for a project.