Skip to content

Commit f97064d

Browse files
authored
Merge pull request #9529 from dotnet-maestro-bot/merge/vs17.9-to-main
[automated] Merge branch 'vs17.9' => 'main'
2 parents f3ccb76 + eea84ad commit f97064d

File tree

5 files changed

+101
-7
lines changed

5 files changed

+101
-7
lines changed

documentation/wiki/ChangeWaves.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ A wave of features is set to "rotate out" (i.e. become standard functionality) t
2828
- [Warning on serialization custom events by default in .NET framework](https://github.com/dotnet/msbuild/pull/9318)
2929
- [Cache SDK resolver data process-wide](https://github.com/dotnet/msbuild/pull/9335)
3030
- [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
31+
- [Change Version switch output to finish with a newline](https://github.com/dotnet/msbuild/pull/9485)
3132

3233
### 17.8
3334
- [[RAR] Don't do I/O on SDK-provided references](https://github.com/dotnet/msbuild/pull/8688)

eng/Version.Details.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@
6868
<Sha>194f32828726c3f1f63f79f3dc09b9e99c157b11</Sha>
6969
<SourceBuild RepoName="xliff-tasks" ManagedOnly="true" />
7070
</Dependency>
71-
<Dependency Name="NuGet.Build.Tasks" Version="6.9.0-preview.1.45">
71+
<Dependency Name="NuGet.Build.Tasks" Version="6.9.0-preview.1.50">
7272
<Uri>https://github.com/nuget/nuget.client</Uri>
73-
<Sha>707c46e558b2b027d7ae942028c369e26545f10a</Sha>
73+
<Sha>a59e64507383b64bcfbe9bf63b34aca946ab0da9</Sha>
7474
</Dependency>
75-
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.9.0-3.23602.1">
75+
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.9.0-3.23608.9">
7676
<Uri>https://github.com/dotnet/roslyn</Uri>
77-
<Sha>e7eb348845964a221e1636e404a295f95f35e1aa</Sha>
77+
<Sha>8e4ab418a8f9703f7dfe3a66adc9b3876ef9382f</Sha>
7878
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
7979
</Dependency>
8080
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="8.0.0-beta.23463.1">

eng/Versions.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
<MicrosoftDotNetXUnitExtensionsVersion>8.0.0-beta.23463.1</MicrosoftDotNetXUnitExtensionsVersion>
5151
<MicrosoftExtensionsDependencyModelVersion>7.0.0</MicrosoftExtensionsDependencyModelVersion>
5252
<MicrosoftIORedistVersion>6.0.0</MicrosoftIORedistVersion>
53-
<MicrosoftNetCompilersToolsetVersion>4.9.0-3.23602.1</MicrosoftNetCompilersToolsetVersion>
54-
<NuGetBuildTasksVersion>6.9.0-preview.1.45</NuGetBuildTasksVersion>
53+
<MicrosoftNetCompilersToolsetVersion>4.9.0-3.23608.9</MicrosoftNetCompilersToolsetVersion>
54+
<NuGetBuildTasksVersion>6.9.0-preview.1.50</NuGetBuildTasksVersion>
5555
<SystemRuntimeCompilerServicesUnsafeVersion>6.0.0</SystemRuntimeCompilerServicesUnsafeVersion>
5656
<SystemTextJsonVersion>7.0.3</SystemTextJsonVersion>
5757
<SystemThreadingTasksDataflowVersion>7.0.0</SystemThreadingTasksDataflowVersion>

src/MSBuild.UnitTests/XMake_Tests.cs

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,91 @@ public void Help(string indicator)
523523
.ShouldBe(MSBuildApp.ExitType.Success);
524524
}
525525

526+
[Fact]
527+
public void VersionSwitch()
528+
{
529+
using TestEnvironment env = UnitTests.TestEnvironment.Create();
530+
531+
// Ensure Change Wave 17.10 is enabled.
532+
ChangeWaves.ResetStateForTests();
533+
env.SetEnvironmentVariable("MSBUILDDISABLEFEATURESFROMVERSION", "");
534+
BuildEnvironmentHelper.ResetInstance_ForUnitTestsOnly();
535+
536+
List<string> cmdLine = new()
537+
{
538+
#if !FEATURE_RUN_EXE_IN_TESTS
539+
EnvironmentProvider.GetDotnetExePath(),
540+
#endif
541+
FileUtilities.EnsureDoubleQuotes(RunnerUtilities.PathToCurrentlyRunningMsBuildExe),
542+
"-nologo",
543+
"-version"
544+
};
545+
546+
using Process process = new()
547+
{
548+
StartInfo =
549+
{
550+
FileName = cmdLine[0],
551+
Arguments = string.Join(" ", cmdLine.Skip(1)),
552+
UseShellExecute = false,
553+
RedirectStandardOutput = true,
554+
},
555+
};
556+
557+
process.Start();
558+
process.WaitForExit();
559+
process.ExitCode.ShouldBe(0);
560+
561+
string output = process.StandardOutput.ReadToEnd();
562+
output.EndsWith(Environment.NewLine).ShouldBeTrue();
563+
564+
process.Close();
565+
}
566+
567+
/// <summary>
568+
/// PR: Change Version switch output to finish with a newline https://github.com/dotnet/msbuild/pull/9485
569+
/// </summary>
570+
[Fact]
571+
public void VersionSwitchDisableChangeWave()
572+
{
573+
using TestEnvironment env = UnitTests.TestEnvironment.Create();
574+
575+
// Disable Change Wave 17.10
576+
ChangeWaves.ResetStateForTests();
577+
env.SetEnvironmentVariable("MSBUILDDISABLEFEATURESFROMVERSION", ChangeWaves.Wave17_10.ToString());
578+
BuildEnvironmentHelper.ResetInstance_ForUnitTestsOnly();
579+
580+
List<string> cmdLine = new()
581+
{
582+
#if !FEATURE_RUN_EXE_IN_TESTS
583+
EnvironmentProvider.GetDotnetExePath(),
584+
#endif
585+
FileUtilities.EnsureDoubleQuotes(RunnerUtilities.PathToCurrentlyRunningMsBuildExe),
586+
"-nologo",
587+
"-version"
588+
};
589+
590+
using Process process = new()
591+
{
592+
StartInfo =
593+
{
594+
FileName = cmdLine[0],
595+
Arguments = string.Join(" ", cmdLine.Skip(1)),
596+
UseShellExecute = false,
597+
RedirectStandardOutput = true,
598+
},
599+
};
600+
601+
process.Start();
602+
process.WaitForExit();
603+
process.ExitCode.ShouldBe(0);
604+
605+
string output = process.StandardOutput.ReadToEnd();
606+
output.EndsWith(Environment.NewLine).ShouldBeFalse();
607+
608+
process.Close();
609+
}
610+
526611
[Fact]
527612
public void ErrorCommandLine()
528613
{

src/MSBuild/XMake.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4487,7 +4487,15 @@ private static void ShowHelpPrompt()
44874487
/// </summary>
44884488
private static void ShowVersion()
44894489
{
4490-
Console.Write(ProjectCollection.Version.ToString());
4490+
// Change Version switch output to finish with a newline https://github.com/dotnet/msbuild/pull/9485
4491+
if (ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_10))
4492+
{
4493+
Console.WriteLine(ProjectCollection.Version.ToString());
4494+
}
4495+
else
4496+
{
4497+
Console.Write(ProjectCollection.Version.ToString());
4498+
}
44914499
}
44924500
}
44934501
}

0 commit comments

Comments
 (0)