Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions documentation/wiki/ChangeWaves.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ A wave of features is set to "rotate out" (i.e. become standard functionality) t
- [Warning on serialization custom events by default in .NET framework](https://github.com/dotnet/msbuild/pull/9318)
- [Cache SDK resolver data process-wide](https://github.com/dotnet/msbuild/pull/9335)
- [Target parameters will be unquoted](https://github.com/dotnet/msbuild/pull/9452), meaning the ';' symbol in the parameter target name will always be treated as separator
- [Change Version switch output to finish with a newline](https://github.com/dotnet/msbuild/pull/9485)

### 17.8
- [[RAR] Don't do I/O on SDK-provided references](https://github.com/dotnet/msbuild/pull/8688)
Expand Down
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
<Sha>194f32828726c3f1f63f79f3dc09b9e99c157b11</Sha>
<SourceBuild RepoName="xliff-tasks" ManagedOnly="true" />
</Dependency>
<Dependency Name="NuGet.Build.Tasks" Version="6.9.0-preview.1.45">
<Dependency Name="NuGet.Build.Tasks" Version="6.9.0-preview.1.50">
<Uri>https://github.com/nuget/nuget.client</Uri>
<Sha>707c46e558b2b027d7ae942028c369e26545f10a</Sha>
<Sha>a59e64507383b64bcfbe9bf63b34aca946ab0da9</Sha>
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.9.0-3.23602.1">
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.9.0-3.23608.9">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>e7eb348845964a221e1636e404a295f95f35e1aa</Sha>
<Sha>8e4ab418a8f9703f7dfe3a66adc9b3876ef9382f</Sha>
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="8.0.0-beta.23463.1">
Expand Down
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
<MicrosoftDotNetXUnitExtensionsVersion>8.0.0-beta.23463.1</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftExtensionsDependencyModelVersion>7.0.0</MicrosoftExtensionsDependencyModelVersion>
<MicrosoftIORedistVersion>6.0.0</MicrosoftIORedistVersion>
<MicrosoftNetCompilersToolsetVersion>4.9.0-3.23602.1</MicrosoftNetCompilersToolsetVersion>
<NuGetBuildTasksVersion>6.9.0-preview.1.45</NuGetBuildTasksVersion>
<MicrosoftNetCompilersToolsetVersion>4.9.0-3.23608.9</MicrosoftNetCompilersToolsetVersion>
<NuGetBuildTasksVersion>6.9.0-preview.1.50</NuGetBuildTasksVersion>
<SystemRuntimeCompilerServicesUnsafeVersion>6.0.0</SystemRuntimeCompilerServicesUnsafeVersion>
<SystemTextJsonVersion>7.0.3</SystemTextJsonVersion>
<SystemThreadingTasksDataflowVersion>7.0.0</SystemThreadingTasksDataflowVersion>
Expand Down
85 changes: 85 additions & 0 deletions src/MSBuild.UnitTests/XMake_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,91 @@ public void Help(string indicator)
.ShouldBe(MSBuildApp.ExitType.Success);
}

[Fact]
public void VersionSwitch()
{
using TestEnvironment env = UnitTests.TestEnvironment.Create();

// Ensure Change Wave 17.10 is enabled.
ChangeWaves.ResetStateForTests();
env.SetEnvironmentVariable("MSBUILDDISABLEFEATURESFROMVERSION", "");
BuildEnvironmentHelper.ResetInstance_ForUnitTestsOnly();

List<string> cmdLine = new()
{
#if !FEATURE_RUN_EXE_IN_TESTS
EnvironmentProvider.GetDotnetExePath(),
#endif
FileUtilities.EnsureDoubleQuotes(RunnerUtilities.PathToCurrentlyRunningMsBuildExe),
"-nologo",
"-version"
};

using Process process = new()
{
StartInfo =
{
FileName = cmdLine[0],
Arguments = string.Join(" ", cmdLine.Skip(1)),
UseShellExecute = false,
RedirectStandardOutput = true,
},
};

process.Start();
process.WaitForExit();
process.ExitCode.ShouldBe(0);

string output = process.StandardOutput.ReadToEnd();
output.EndsWith(Environment.NewLine).ShouldBeTrue();

process.Close();
}

/// <summary>
/// PR: Change Version switch output to finish with a newline https://github.com/dotnet/msbuild/pull/9485
/// </summary>
[Fact]
public void VersionSwitchDisableChangeWave()
{
using TestEnvironment env = UnitTests.TestEnvironment.Create();

// Disable Change Wave 17.10
ChangeWaves.ResetStateForTests();
env.SetEnvironmentVariable("MSBUILDDISABLEFEATURESFROMVERSION", ChangeWaves.Wave17_10.ToString());
BuildEnvironmentHelper.ResetInstance_ForUnitTestsOnly();

List<string> cmdLine = new()
{
#if !FEATURE_RUN_EXE_IN_TESTS
EnvironmentProvider.GetDotnetExePath(),
#endif
FileUtilities.EnsureDoubleQuotes(RunnerUtilities.PathToCurrentlyRunningMsBuildExe),
"-nologo",
"-version"
};

using Process process = new()
{
StartInfo =
{
FileName = cmdLine[0],
Arguments = string.Join(" ", cmdLine.Skip(1)),
UseShellExecute = false,
RedirectStandardOutput = true,
},
};

process.Start();
process.WaitForExit();
process.ExitCode.ShouldBe(0);

string output = process.StandardOutput.ReadToEnd();
output.EndsWith(Environment.NewLine).ShouldBeFalse();

process.Close();
}

[Fact]
public void ErrorCommandLine()
{
Expand Down
10 changes: 9 additions & 1 deletion src/MSBuild/XMake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4487,7 +4487,15 @@ private static void ShowHelpPrompt()
/// </summary>
private static void ShowVersion()
{
Console.Write(ProjectCollection.Version.ToString());
// Change Version switch output to finish with a newline https://github.com/dotnet/msbuild/pull/9485
if (ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_10))
{
Console.WriteLine(ProjectCollection.Version.ToString());
}
else
{
Console.Write(ProjectCollection.Version.ToString());
}
}
}
}