Vixen
02b45cc4
csharp
public sealed class ImportCache

What the last import of each asset produced.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

This is what resolves the cache key's chicken and egg. The key includes the artefact ids of everything the import depended on — and what it depends on is only known once it has run. So the key is computed from the dependencies the previous import declared: if they have not changed, neither has the answer, and the import is skipped; if any of them has, the key differs and the import runs, declaring a fresh set as it goes.

A newly-declared dependency is therefore respected from the second import onwards, not the first — which is exactly right, because the first import is the one that ran and produced a correct artefact. Every incremental build system reaches this answer; it is worth writing down because it looks like a bug until it is stated.

Tab-separated text, like the GUID index it sits next to. It lives in Library/, so it is never committed and never has to be compatible with anything — and a hundred thousand entries of it are read line by line rather than parsed as one document.

Fields and properties (2)

  • public int Count

    How many assets have a record.

  • public IReadOnlyCollection<ImportRecord> Records

    Every record.

Methods (5)

  • public bool TryGet(AssetId asset, out ImportRecord? record)

    Looks up what an asset's last import produced.

  • public void Set(ImportRecord record)

    Records an import.

  • public bool Forget(AssetId asset)

    Forgets an asset, so its next import runs.

  • public void Save(string path)

    Writes the cache.

  • public bool TryLoad(string path)

    Reads the cache back, if it is there.

Used by (12)

  • BuildPlannerVixen.Editor.Assets
  • ContentTasksVixen.Editor.App
  • DoctorRunnerVixen.Cli
  • EditorContentVixen.Editor.App
  • ImportPipelineVixen.Editor.Assets
  • ImportPipelineTestsVixen.Editor.Assets.Tests
  • LooseContentTestsVixen.Editor.Assets.Tests
  • PlannedProjectVixen.Editor.Assets.Tests
  • ProjectVixen.Cli
  • ProjectMeshSourceVixen.Editor.Assets
  • ProjectSurfaceSourceVixen.Editor.Assets
  • ProjectWorkspaceVixen.Editor.Assets