Persistent cache for fingerprinted AST fragments.
Stores %{file_path => %{mtime: integer(), fragments: [fragment], ast: Macro.t() | nil}}
to disk. On subsequent runs, only files whose mtime has changed need to be
re-parsed and fingerprinted.
The cache is invalidated when the config changes (min_mass, literal_mode, normalize_pipes, excluded_macros) since these affect fingerprint output.
Summary
Functions
Build a cache entry for a single file with its current mtime.
Compute a fingerprint of config fields that affect cached fragments.
Default cache file path (relative to the project root).
Get the modification time of a file as a POSIX timestamp.
Merge fresh fragments into the cache, dropping entries for files that no longer exist on disk.
Read cached entries from disk. Returns an empty map if the file is missing, corrupt, config has changed, or was written by an incompatible cache version.
Return the subset of files whose mtime differs from the cached value
(or that aren't in the cache at all).
Write entries to the cache file.
Types
Functions
Build a cache entry for a single file with its current mtime.
@spec config_hash(ExDNA.Config.t()) :: binary()
Compute a fingerprint of config fields that affect cached fragments.
@spec default_path() :: String.t()
Default cache file path (relative to the project root).
Get the modification time of a file as a POSIX timestamp.
Merge fresh fragments into the cache, dropping entries for files that no longer exist on disk.
Read cached entries from disk. Returns an empty map if the file is missing, corrupt, config has changed, or was written by an incompatible cache version.
Return the subset of files whose mtime differs from the cached value
(or that aren't in the cache at all).
Write entries to the cache file.