Skip to content

Commit

Permalink
Fix GitVersion 6
Browse files Browse the repository at this point in the history
  • Loading branch information
dorssel committed Aug 1, 2024
1 parent 8078826 commit 1233db2
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ SPDX-License-Identifier: GPL-3.0-only

<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" PrivateAssets="all" />
<Compile Include="$(MSBuildThisFileDirectory)Fake_GitVersionInformation.cs" Condition=" '$(MSBuildRuntimeType)' != 'Core' " />
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2024 Frans van Dorsselaer
SPDX-License-Identifier: GPL-3.0-only
-->
<Project>

<PropertyGroup>
<!-- Fix GitVersion -->
<GitVersionFileExe>dotnet &quot;$(PkgGitVersion_MsBuild)/tools/net8.0/gitversion.dll&quot;</GitVersionFileExe>
<GitVersionAssemblyFile>$(PkgGitVersion_MsBuild)/tools/net8.0/GitVersion.MsBuild.dll</GitVersionAssemblyFile>
</PropertyGroup>

</Project>
46 changes: 46 additions & 0 deletions Fake_GitVersionInformation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// SPDX-FileCopyrightText: 2024 Frans van Dorsselaer
//
// SPDX-License-Identifier: GPL-3.0-only

// This file is compiled only when building from Visual Studio, which is incompatible with GitVersion 6.
// To get accurate versioning, build from the command line with 'dotnet build' instead.

using System.Diagnostics.CodeAnalysis;

[ExcludeFromCodeCoverage]
static class GitVersionInformation
{
public static string Major = "0";
public static string Minor = "9";
public static string Patch = "99";
public static string PreReleaseTag = "";
public static string PreReleaseTagWithDash = "";
public static string PreReleaseLabel = "";
public static string PreReleaseLabelWithDash = "";
public static string PreReleaseNumber = "";
public static string WeightedPreReleaseNumber = "60000";
public static string BuildMetaData = "999";
public static string BuildMetaDataPadded = "0999";
public static string FullBuildMetaData = "999.Branch.vs.Sha.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
public static string MajorMinorPatch = "0.9.99";
public static string SemVer = "0.9.99";
public static string LegacySemVer = "0.9.99";
public static string LegacySemVerPadded = "0.9.99";
public static string AssemblySemVer = "0.9.99.0";
public static string AssemblySemFileVer = "0.9.99.0";
public static string FullSemVer = "0.9.99+999";
public static string InformationalVersion = "0.9.99+999.Branch.vs.Sha.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
public static string BranchName = "vs";
public static string EscapedBranchName = "vs";
public static string Sha = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; // DevSkim: ignore DS173237
public static string ShortSha = "aaaaaaa";
public static string NuGetVersionV2 = "0.9.99";
public static string NuGetVersion = "0.9.99";
public static string NuGetPreReleaseTagV2 = "";
public static string NuGetPreReleaseTag = "";
public static string VersionSourceSha = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; // DevSkim: ignore DS173237
public static string CommitsSinceVersionSource = "999";
public static string CommitsSinceVersionSourcePadded = "0999";
public static string UncommittedChanges = "9";
public static string CommitDate = "2024-07-27";
}
2 changes: 2 additions & 0 deletions usbipd-win.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
codecov.yml = codecov.yml
COPYING.md = COPYING.md
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Packages.props = Directory.Packages.props
Fake_GitVersionInformation.cs = Fake_GitVersionInformation.cs
GitVersion.yml = GitVersion.yml
global.json = global.json
nuget.config = nuget.config
Expand Down

0 comments on commit 1233db2

Please sign in to comment.