Skip to content

Config Phase 1 — shared buildvana.json configuration library + loader #268

Description

@rdeago

Sub-issue of #267.

Scope

  • New host-agnostic library (Core-tier; System.Text.Json + BCL only, no MSBuild/git) holding the typed BuildvanaConfig model + section records and the loader. Referenced by Buildvana.Tool now and Buildvana.Sdk.Tasks later (Phase 6).
  • Discovery anchored at the home directory: load buildvana.json xor buildvana.jsonc; fail if both are present. Absent file ⇒ all defaults.
  • Parse options: ReadCommentHandling=Skip, AllowTrailingCommas, JsonUnmappedMemberHandling.Disallow (hard-fail unknown keys). A $schema member is whitelisted. Dictionary-typed sections (dotnet.args, nuget.feeds) get explicit key validation, since Disallow doesn't cover dictionary keys.
  • Failures reported via BuildFailedException with clear messages.
  • Register as a singleton in the tool's DI.
  • Generate the JSON schema from the typed model (reusing [Description]s for hover docs), commit it, and add a test that regenerates and fails on staleness.
  • SDK home-marker change: add buildvana.json/.jsonc as the top-priority marker (existence check only — the SDK does not parse it here), keep .buildvana-home and .git*, bail-if-both; apply identically in HomeDirectoryDiscovery and Sdk.props.

Acceptance criteria

  • The library builds and is referenced by Buildvana.Tool; an absent config file yields defaults and no behavior change anywhere.
  • A malformed file, an unknown key, an unknown dictionary key, or both .json+.jsonc present each fail with a clear message.
  • The committed schema matches the model (staleness test passes); editors validate buildvana.json against it.
  • Home-directory discovery recognizes buildvana.json/.jsonc and still recognizes .buildvana-home/.git*, in both the tool and the SDK.
  • CHANGELOG: add an Unreleased entry introducing the (still inert) configuration file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement[issue/PR] requests / implements new or improved functionality.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions