Table of Contents

Method From

Namespace
Ubiquity.NET.Versioning
Assembly
Ubiquity.NET.Versioning.dll

From(ulong, IReadOnlyCollection<string>?)

Converts a file version form (as a ulong) of a CSemVer into a full CSemVer

public static CSemVer From(ulong fileVersion, IReadOnlyCollection<string>? buildMetaData = null)

Parameters

fileVersion ulong

File version as an unsigned 64 bit value

buildMetaData IReadOnlyCollection<string>

Optional build meta data value for the version

Returns

CSemVer

CSemVer for the specified file version

Remarks

A file version is a quad of 4 ushort values. This is convertible to a ulong in the following pattern: (bits are numbered with MSB as the highest numeric value [Actual ordering depends on platform endianess])

FieldDescription
bits 48-63 Major part of Build number
bits 32-47 Minor part of Build number
bits 16-31 Build part of Build number
bits 0-15 Revision part of Build number (Odd Numbers indicate a CI build

A file version cast as a ulong is NOT the same as an Ordered version number. The file version includes a "bit" for the status as a CI Build. Thus a "file version" as a ulong is the ordered version shifted left by one bit and the LSB indicates if it is a CI build or release

From(string, IReadOnlyCollection<string>?)

Factory method to create a CSemVer from information available as part of a build

public static CSemVer From(string buildVersionXmlPath, IReadOnlyCollection<string>? buildMeta)

Parameters

buildVersionXmlPath string

Path to the BuildVersion XML data for the repository

buildMeta IReadOnlyCollection<string>

Additional Build meta data for the build

Returns

CSemVer

Version information parsed from the build XML