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.
Sub-issue of #267. (Pure library; lands after Phase 1 but doesn't depend on it.)
Scope
src/Buildvana.Versioning/targeting$(StandardTfm), dependencyNuGet.Versioningonly — no git, MSBuild, or config dependency.VersionSpecverbatim fromBuildvana.Tool.VersionFileData— immutable record parsed fromcurrent-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=branchNamematches any regex (short name, explicit anchors). NopathFilters.current-version.jsonparsing (valid, malformed).nbgvuntil Phase 5) — no behavior change.Acceptance criteria
VersionSpecno longer exists underBuildvana.Tool.VersionCalculatorandVersionFileDatapass in CI.bvbehavior is unchanged at this phase (NBGV still in use).