Skip to content

Commit 3e1529a

Browse files
committed
Expanded spec and changed version number
1 parent f83c165 commit 3e1529a

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

docs/specification.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,37 @@ To use GmodNET.VersionTool.MSBuild one just should reference corresponding NuGet
6666
## GmodNET.VersionTool.SourceGenerator
6767

6868
GmodNET.VersionTool.SourceGenerator package contains C# Source Generator,
69-
which generates a `GmodNET.VersionTool.Info.cs` file, which contains build version data.
69+
which generates a `GmodNET.VersionTool.Info.cs` file, which contains build version data:
70+
71+
```csharp
72+
using System;
73+
74+
namespace GmodNET.VersionTool.Info
75+
{
76+
internal static class BuildInfo
77+
{
78+
/// <summary>
79+
/// Gets a full version with build metadata.
80+
/// </summary>
81+
public static string FullVersion => "3.4.5-beta.2.60030416.main+head.main.commit.e0c1ad9f485ea34ea5ad640d60487ec46e238c44";
82+
83+
/// <summary>
84+
/// Gets a version without build metadata.
85+
/// </summary>
86+
public static string VersionWithoutBuildData => "3.4.5-beta.2.60030416.main";
87+
88+
/// <summary>
89+
/// Gets build's commit git repository HEAD name in human-readable format.
90+
/// </summary>
91+
public static string BranchName => "main";
92+
93+
/// <summary>
94+
/// Gets build's commit hash as a hex string.
95+
/// </summary>
96+
public static string CommitHash => "e0c1ad9f485ea34ea5ad640d60487ec46e238c44";
97+
}
98+
}
99+
```
70100

71101
Path to version file is specified via `VersionFile` MSBuild Item,
72102
just like with GmodNET.VersionTool.MSBuild.

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"Version": "2.1.0-alpha.1"
2+
"Version": "2.1.0-rc.1"
33
}

0 commit comments

Comments
 (0)