tom_analyzer_shared 0.2.0
tom_analyzer_shared: ^0.2.0 copied to clipboard
Shared analyzer-summary caching infrastructure reused by Tom code generators (reflection, d4rt bridges, etc).
Changelog #
0.2.0 #
- Added
resolveDartSdkPath()andlooksLikeDartSdk()— a robust runtime Dart SDK locator (insrc/sdk/dart_sdk_locator.dart). The analyzer derives the SDK fromPlatform.resolvedExecutable, which is correct underdart runbut fails for AOT-compiled tools (dart compile exe) where the executable is the tool itself, not thedartbinary. The locator triesDART_SDK/DART_HOME, the resolved executable, and thedart/flutterexecutables onPATH(handling the Flutterbin/cache/dart-sdklayout), validating every candidate against the SDK marker file before returning it. The result is cached for the process lifetime. SummaryGeneratornow usesresolveDartSdkPath()to locate the SDK summary directory, fixing aPathNotFoundExceptionforlib/_internal/allowed_experiments.jsonwhen run from a compiled binary.
0.1.0 #
- Initial release. Extracted summary-caching infrastructure from
tom_reflection_generatorinto a reusable library so multiple code generators (reflection, d4rt bridges, ...) can share the same<workspace>/.tom/analyzer-cache/directory. - Public API:
PackageDependency,DependencySetDependencyResolver(parsespubspec.lock, locates hosted/SDK package sources)SummaryCacheManager(reads/writes{name}@{version}.sumfiles)SummaryGenerator(generates the SDK summary and per-package summaries in topological order)runSummaryCacheStage()andSummaryCacheResult— reusable orchestration helper that resolves dependencies, generates missing summaries, and returns the paths to pass toAnalysisContextCollectionImpl.