Skip to content

Commit d5497c6

Browse files
committed
Extended specification with implementation details; Updated built-in docs for packages
1 parent 1697712 commit d5497c6

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

GmodNET.VersionTool.Core/VersionGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ public string VersionWithoutBuildData
4040
}
4141

4242
/// <summary>
43-
/// Returnes the current git repositiry HEAD branch name in human-readable format.
43+
/// Returnes the current git repositiry HEAD name in human-readable format.
4444
/// </summary>
4545
public string BranchName
4646
{
4747
get {return branch_name;}
4848
}
4949

5050
/// <summary>
51-
/// Returnes first 7 symbols of the current git commit hash.
51+
/// Returnes current git commit hash as a hex string.
5252
/// </summary>
5353
public string CommitHash
5454
{

GmodNET.VersionTool/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static int Main(string[] args)
4747
}
4848
});
4949

50-
Command getCommitCommand = new Command("getCommit", "Get the git commit hash (first 7 symbols) of the the given version.");
50+
Command getCommitCommand = new Command("getCommit", "Get the current git commit hash.");
5151

5252
getCommitCommand.AddArgument(path_to_version_file_arg);
5353

@@ -58,7 +58,7 @@ static int Main(string[] args)
5858
Console.WriteLine(versionGenerator.CommitHash);
5959
});
6060

61-
Command getBranchNameCommand = new Command("getBranchName", "Get the git branch of the given version.");
61+
Command getBranchNameCommand = new Command("getBranchName", "Get the current git HEAD name.");
6262

6363
getBranchNameCommand.AddArgument(path_to_version_file_arg);
6464

docs/specification.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,32 @@ The resulting version number has the form `[FullVersion]+codename.[codename from
3333
"Codename": "Ural"
3434
}
3535
```
36+
37+
## GmodNET.VersionTool.Core NuGet package
38+
39+
GmodNET.VersionTool.Core package is .NET library which exposes `VersionGenerator` class.
40+
41+
`VersionGenerator` constructor takes path to a version file and returns an instance with build data which can be accessed via `FullVersion`, `VersionWithoutBuildData`, `BranchName`, and `CommitHash` properties.
42+
43+
44+
## GmodNET.VersionTool CLI tool
45+
46+
GmodNET.VersionTool is a [.NET command line tool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools) which can be acquired via NuGet. GmodNET.VersionTool has short name `gmodnet-vt`and can be invoked as `dotnet gmodnet-vt` if installed as local tool and simply as `gmodnet-vt` if installed as global tool.
47+
48+
GmodNET.VersionTool can provide full generated version, build version without build metadata, git HEAD name, and commit hash.
49+
50+
GmodNET.VersionTool has built-in usage help.
51+
52+
53+
## GmodNET.VersionTool.MSBuild NuGet package
54+
55+
GmodNET.VersionTool.MSBuild package contains MSBuild Tasks and Targets to automatically set `Version` and `PackageVersion` properties of MSBuild project on build.
56+
57+
To use GmodNET.VersionTool.MSBuild one just should reference corresponding NuGet package and specify version file via `VersionFile` item in the project file:
58+
59+
```xml
60+
<ItemGroup>
61+
<PackageReference Include="GmodNET.VersionTool.MSBuild" Version="2.0.0" PrivateAssets="All"/>
62+
<VersionFile Include="../version.json" />
63+
</ItemGroup>
64+
```

0 commit comments

Comments
 (0)