generated from dotnet/new-repo
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump required SDK to 8+ and remove fixed issues (#52)
Bump the minimum required version of MSBuild to 17.8.0, which corresponds to .NET SDK 8, which will soon be oldest supported version of the SDK (see https://learn.microsoft.com/en-us/dotnet/core/porting/versioning-sdk-msbuild-vs). Doing so allows us to clean up / slim down the package: - Remove our references to SourceLink, since it's now provided by the SDK (reference: https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/source-link) - Remove setting `<EmbedUntrackedSources>` as it's already set to the same value by the SDK (reference: https://github.com/dotnet/sdk/pull/31632/files#diff-0adc92e620c2edfd1285b34be242429af4ff7116be50f6685b146b5c31a4de44R19) - Remove setting `<IncludePackageReferencesDuringMarkupCompilation>` as it's already set to the same value by the SDK (reference: https://github.com/dotnet/sdk/pull/15465/files#diff-7d043b70287c061ddd2cc5ccc8ad0547b629b0eb9c60f3bce15b3b0f353744b9R26) I also added unit tests and updated docs.
- Loading branch information
1 parent
f2c641c
commit 714df2e
Showing
5 changed files
with
32 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
tests/DotNet.ReproducibleBuilds.Tests/MinimumVersionTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using FluentAssertions; | ||
using Microsoft.Build.Utilities.ProjectCreation; | ||
|
||
namespace DotNet.ReproducibleBuilds.Tests; | ||
|
||
public class MinimumVersionTests : TestBase | ||
{ | ||
[Theory] | ||
[InlineData("17.7.0", false)] | ||
[InlineData("17.8.0", true)] | ||
[InlineData("17.9.0", true)] | ||
public void BelowMinimumVersionEmitsWarning(string msbuildVersion, bool success) | ||
{ | ||
Dictionary<string, string> globalProperties = new() | ||
{ | ||
["_ReproducibleBuildsMSBuildVersion"] = msbuildVersion | ||
}; | ||
|
||
ProjectCreator.Templates | ||
.ReproducibleBuildProject(GetRandomFile(".csproj")) | ||
.TryBuild(restore: false, target: "_ReproducibleBuildsMSBuildVersionCheck", globalProperties, out bool result, out BuildOutput output); | ||
|
||
result.Should().BeTrue(); | ||
output.Warnings.Should().HaveCount(success ? 0 : 1); | ||
} | ||
} |