Skip to content

Versioning Phase 4 — create the Buildvana.Versioning shared library #271

@rdeago

Description

@rdeago

Sub-issue of #267. (Pure library; lands after Phase 1 but doesn't depend on it.)

Scope

  • New src/Buildvana.Versioning/ targeting $(StandardTfm), dependency NuGet.Versioning only — no git, MSBuild, or config dependency.
  • Move VersionSpec verbatim from Buildvana.Tool.
  • VersionFileData — immutable record parsed from current-version.json ({ major, minor, prerelease }); reject malformed input. Define the "fail loudly if the file is absent" contract for callers.
  • VersionCalculator.Compute(fileData, height, branchName, publicReleaseRegexes, prereleaseTag){ SemanticVersion, CurrentStr, IsPublicRelease, IsPrerelease }. Branch regexes and the prerelease tag are inputs (callers source them from config); IsPublicRelease = branchName matches any regex (short name, explicit anchors). No pathFilters.
  • Unit tests: version-string construction, regex matching (empty list, detached-HEAD/empty branch), current-version.json parsing (valid, malformed).
  • The library is added and tested but not yet wired into the live tool path (the tool still uses nbgv until Phase 5) — no behavior change.

Acceptance criteria

  • Library builds cleanly; VersionSpec no longer exists under Buildvana.Tool.
  • Unit tests for VersionCalculator and VersionFileData pass in CI.
  • bv behavior is unchanged at this phase (NBGV still in use).
  • CHANGELOG: internal-only; note the new library if surfaced, otherwise no public entry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement[issue/PR] requests / implements new or improved functionality.refactor[issue/PR] requests / implements a refactor of existing code without affecting functionality.
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions