Skip to content

Commit

Permalink
Maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
dorssel committed Dec 2, 2024
1 parent a46c78c commit 3346051
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ obj/
TestResults/

*.user
*.lutconfig

2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ SPDX-License-Identifier: MIT
<!-- NuGet metadata -->
<Title>$(Product)</Title>
<Authors>$(Company)</Authors>
<Description>Alternative GitVersion.MsBuild that is compatible with Visual Studio.</Description>
<Description>Alternative to GitVersion.MsBuild, compatible with Visual Studio.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<UseFullSemVerForNuGet>false</UseFullSemVerForNuGet>
Expand Down
4 changes: 1 addition & 3 deletions GitVersion.MsBuild/GenerateGitVersionInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ namespace {{targetNamespace}}
}
else
{
_ = builder.Append($$"""
{{namespaceContent}}
""");
_ = builder.Append(namespaceContent);
}

// NOTE: Original GitVersion.MsBuild always generates UNIX line endings, even on Windows.
Expand Down
1 change: 0 additions & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/GitTools/GitVersion/main/schemas/6.0/GitVersion.configuration.json

assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.{env:GITHUB_RUN_NUMBER ?? 0}'
next-version: 1.0.0
13 changes: 3 additions & 10 deletions UnitTests/TaskTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,9 @@ sealed class TaskTests

static string GetVersionFile()
{
for (var directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
directory is not null; directory = Path.GetDirectoryName(directory))
{
var file = Path.Combine(directory, "obj", "gitversion.json");
if (File.Exists(file))
{
return file;
}
}
throw new FileNotFoundException("gitversion.json");
var directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!;
var file = Path.Combine(directory, "gitversion.json");
return File.Exists(file) ? file : throw new FileNotFoundException("gitversion.json");
}

[TestMethod]
Expand Down
5 changes: 5 additions & 0 deletions UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ SPDX-License-Identifier: MIT
<MicrosoftNETTestSdkVersion>17.12.0</MicrosoftNETTestSdkVersion>
</PropertyGroup>

<ItemGroup>
<!-- Required for (Live) Unit Testing -->
<Content Include="$(GitVersionOutputFile)" Link="gitversion.json" CopyToOutputDirectory="PreserveNewest" Visible="false" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GitVersion.MsBuild\GitVersion.MsBuild.csproj" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions gitversion-msbuild.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Packages.props = Directory.Packages.props
GitVersion.yml = GitVersion.yml
global.json = global.json
README.md = README.md
EndProjectSection
Expand Down

0 comments on commit 3346051

Please sign in to comment.