Vixen
02b45cc4
csharp
public sealed class ProjectWorkspace

The on-disk stores importing and building a project need, opened together.

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

Remarks

Four things that have to agree about which directory they are looking at. The GUID index, the artefact store, the import cache and the file provider are separate objects with separate lifetimes, and pointing one of them at the wrong place produces a build with no content in it and no error. Opening them as a unit is what makes that unrepresentable.

⚠ Here rather than in the CLI, which is where it was, because the editor needs the same four. Two orchestrations over the same components drift, and the way this particular drift shows up is the editor and vixen content build producing different output for one project — which reads as a machine problem for as long as it takes somebody to compare two catalogs by hand. This assembly's whole stated job is the part shared with the CLI.

Nothing here is lazy. Opening a workspace means the directories exist, the index is readable and the artefact store can be written to — better discovered before an import has run for two minutes than after.

Fields and properties (9)

  • public ProjectPaths Paths

    What a project's directories are called.

  • public AssetDatabase Database

    The GUID index over Assets/.

  • public ObjectDatabase Artifacts

    Where imported chunks are stored, under Library/.

  • public IOdbBackend Chunks

    The store behind Artifacts, which is what a content build packs from.

  • public ImportCache Cache

    What the last import of each asset produced.

  • public string CacheFile

    Where the import cache is written.

  • public IFileProvider Files

    Source files, rooted at the project, which is what an importer's paths are relative to.

  • public ProjectSettingsStore Settings

    The committed settings under ProjectSettings/.

  • public static string HostTarget

    The build target to assume when nobody said.

Methods (6)

  • public ProjectWorkspace(ProjectPaths paths)

    Opens the stores for a project.

  • public static ImporterRegistry Importers()

    Which importers this build of the engine has.

  • public string DefaultOutput(string target)

    Where a build for a target goes when nobody said.

  • public List<AddressableGroup> Groups(out List<string> failures)

    Reads every .vxgroup the project defines.

  • public void Save()

    Writes the index and the import cache back.

  • public static bool IsProject(string directory)

    Whether a directory looks like a project.

Used by (14)

  • AssetPickerVixen.Editor.App
  • BuildSettingsViewVixen.Editor.App
  • ContentPipelineVixen.Editor.Assets
  • ContentPipelineTestsVixen.Editor.Assets.Tests
  • ContentTasksVixen.Editor.App
  • EditorApplicationVixen.Editor.App
  • EditorContentVixen.Editor.App
  • EditorContentTestsVixen.Editor.App.Tests
  • LooseContentVixen.Editor.Assets
  • LooseContentTestsVixen.Editor.Assets.Tests
  • ProjectVixen.Cli
  • ProjectMeshSourceVixen.Editor.Assets
  • ProjectSurfaceSourceVixen.Editor.Assets
  • SceneManifestTestsVixen.Editor.Assets.Tests