Skip to content

Commit ed5f88d

Browse files
[release/7.0.x] Source code updates from dotnet/dotnet (#7061)
[release/7.0.x] Source code updates from dotnet/dotnet
1 parent 57f5488 commit ed5f88d

9 files changed

Lines changed: 43 additions & 28 deletions

File tree

eng/Version.Details.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ This file should be imported by eng/Versions.props
2121
<!-- dotnet/corefx dependencies -->
2222
<SystemComponentModelCompositionPackageVersion>4.5.0</SystemComponentModelCompositionPackageVersion>
2323
<!-- dotnet/dotnet dependencies -->
24-
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.26057.111</MicrosoftDotNetArcadeSdkPackageVersion>
25-
<MicrosoftDotNetXliffTasksPackageVersion>10.0.0-beta.26057.111</MicrosoftDotNetXliffTasksPackageVersion>
24+
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.26065.102</MicrosoftDotNetArcadeSdkPackageVersion>
25+
<MicrosoftDotNetXliffTasksPackageVersion>10.0.0-beta.26065.102</MicrosoftDotNetXliffTasksPackageVersion>
2626
</PropertyGroup>
2727
<!--Property group for alternate package version names-->
2828
<PropertyGroup>

eng/Version.Details.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Dependencies>
3-
<Source Uri="https://github.com/dotnet/dotnet" Mapping="nuget-client" Sha="4ef9fba1ed958b047163527960c27baf2883f835" BarId="296350" />
3+
<Source Uri="https://github.com/dotnet/dotnet" Mapping="nuget-client" Sha="99f9e99f92d73ade5453ba8edba5d72247f3cd11" BarId="297507" />
44
<!--
55
Currently this file is required to publish builds to .NET build asset registry.
66
See https://github.com/dotnet/arcade/issues/2396 for details.
@@ -56,13 +56,13 @@
5656
</Dependency>
5757
</ProductDependencies>
5858
<ToolsetDependencies>
59-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.26057.111">
59+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.26065.102">
6060
<Uri>https://github.com/dotnet/dotnet</Uri>
61-
<Sha>4ef9fba1ed958b047163527960c27baf2883f835</Sha>
61+
<Sha>99f9e99f92d73ade5453ba8edba5d72247f3cd11</Sha>
6262
</Dependency>
63-
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="10.0.0-beta.26057.111">
63+
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="10.0.0-beta.26065.102">
6464
<Uri>https://github.com/dotnet/dotnet</Uri>
65-
<Sha>4ef9fba1ed958b047163527960c27baf2883f835</Sha>
65+
<Sha>99f9e99f92d73ade5453ba8edba5d72247f3cd11</Sha>
6666
</Dependency>
6767
</ToolsetDependencies>
6868
</Dependencies>

eng/common/core-templates/job/publish-build-assets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
# If it's not devdiv, it's dnceng
8181
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
8282
name: NetCore1ESPool-Publishing-Internal
83-
image: windows.vs2019.amd64
83+
image: windows.vs2022.amd64
8484
os: windows
8585
steps:
8686
- ${{ if eq(parameters.is1ESPipeline, '') }}:

eng/common/core-templates/post-build/post-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,11 @@ stages:
293293
${{ else }}:
294294
${{ if eq(parameters.is1ESPipeline, true) }}:
295295
name: NetCore1ESPool-Publishing-Internal
296-
image: windows.vs2019.amd64
296+
image: windows.vs2022.amd64
297297
os: windows
298298
${{ else }}:
299299
name: NetCore1ESPool-Publishing-Internal
300-
demands: ImageOverride -equals windows.vs2019.amd64
300+
demands: ImageOverride -equals windows.vs2022.amd64
301301
steps:
302302
- template: /eng/common/core-templates/post-build/setup-maestro-vars.yml
303303
parameters:

eng/common/templates/variables/pool-providers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#
2424
# pool:
2525
# name: $(DncEngInternalBuildPool)
26-
# demands: ImageOverride -equals windows.vs2019.amd64
26+
# demands: ImageOverride -equals windows.vs2022.amd64
2727
variables:
2828
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
2929
- template: /eng/common/templates-official/variables/pool-providers.yml

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"pinned": true
1010
},
1111
"msbuild-sdks": {
12-
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26057.111",
12+
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26065.102",
1313
"Microsoft.Build.NoTargets": "3.7.0"
1414
}
1515
}

src/NuGet.Core/NuGet.CommandLine.XPlat/Commands/Why/WhyCommand.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ internal static void Register(CommandLineApplication app)
2323
});
2424
}
2525

26-
internal static void Register(Command rootCommand, IAnsiConsole console)
26+
internal static void Register(Command rootCommand, Lazy<IAnsiConsole> console)
2727
{
2828
Register(rootCommand, console, WhyCommandRunner.ExecuteCommand);
2929
}
@@ -36,11 +36,13 @@ internal static void Register(Command rootCommand, IAnsiConsole console)
3636
public static void GetWhyCommand(Command rootCommand)
3737
{
3838
Register(rootCommand,
39-
Spectre.Console.AnsiConsole.Console,
39+
new Lazy<IAnsiConsole>(() => Spectre.Console.AnsiConsole.Console),
4040
WhyCommandRunner.ExecuteCommand);
4141
}
4242

43-
internal static void Register(Command rootCommand, IAnsiConsole console, Func<WhyCommandArgs, Task<int>> action)
43+
// console must be lazy, because Spectre.Console's AnsiConsole will send VT sequences to the output
44+
// as soon as it's created, which causes problems with the dotnet CLI's C++ output, like dotnet --info
45+
internal static void Register(Command rootCommand, Lazy<IAnsiConsole> console, Func<WhyCommandArgs, Task<int>> action)
4446
{
4547
var whyCommand = new DocumentedCommand("why", Strings.WhyCommand_Description, "https://aka.ms/dotnet/nuget/why");
4648

@@ -109,15 +111,15 @@ bool HasPathArgument(ArgumentResult ar)
109111
parseResult.GetValue(path)!,
110112
parseResult.GetValue(package)!,
111113
parseResult.GetValue(frameworks)!,
112-
console,
114+
console.Value,
113115
cancellationToken);
114116

115117
int exitCode = await action(whyCommandArgs);
116118
return exitCode;
117119
}
118120
catch (ArgumentException ex)
119121
{
120-
console.Markup($"[red]{ex.Message}[/]");
122+
console.Value.Markup($"[red]{ex.Message}[/]");
121123
return ExitCodes.InvalidArguments;
122124
}
123125
});

src/NuGet.Core/NuGet.CommandLine.XPlat/Program.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,12 @@ public static int MainInternal(string[] args, CommandOutputLogger log, IEnvironm
106106
var nugetCommand = new Command("nuget");
107107
rootCommand.Subcommands.Add(nugetCommand);
108108

109+
var lazyConsole = new Lazy<Spectre.Console.IAnsiConsole>(() => Spectre.Console.AnsiConsole.Console);
110+
109111
ConfigCommand.Register(nugetCommand, getHidePrefixLogger);
110112
ConfigCommand.Register(rootCommand, getHidePrefixLogger);
111-
Commands.Why.WhyCommand.Register(nugetCommand, Spectre.Console.AnsiConsole.Console);
112-
Commands.Why.WhyCommand.Register(rootCommand, Spectre.Console.AnsiConsole.Console);
113+
Commands.Why.WhyCommand.Register(nugetCommand, lazyConsole);
114+
Commands.Why.WhyCommand.Register(rootCommand, lazyConsole);
113115
}
114116

115117
CancellationTokenSource tokenSource = new CancellationTokenSource();

test/NuGet.Core.Tests/NuGet.CommandLine.Xplat.Tests/Commands/Why/WhyCommandLineParsingTests.cs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using FluentAssertions;
88
using NuGet.CommandLine.XPlat.Commands;
99
using NuGet.CommandLine.XPlat.Commands.Why;
10+
using Spectre.Console;
1011
using Spectre.Console.Testing;
1112
using Xunit;
1213

@@ -19,9 +20,10 @@ public void WhyCommand_HasHelpUrl()
1920
{
2021
// Arrange
2122
Command rootCommand = new("nuget");
23+
var console = new Lazy<IAnsiConsole>(() => new TestConsole());
2224

2325
// Act
24-
WhyCommand.Register(rootCommand, new TestConsole());
26+
WhyCommand.Register(rootCommand, console);
2527

2628
// Assert
2729
rootCommand.Subcommands[0].Should().BeAssignableTo<DocumentedCommand>();
@@ -33,8 +35,10 @@ public void WithTwoArguments_PathAndPackageAreSet()
3335
{
3436
// Arrange
3537
Command rootCommand = new("nuget");
38+
var console = new Lazy<IAnsiConsole>(() => new TestConsole());
3639

37-
WhyCommand.Register(rootCommand, new TestConsole(), whyCommandArgs =>
40+
41+
WhyCommand.Register(rootCommand, console, whyCommandArgs =>
3842
{
3943
// Assert
4044
whyCommandArgs.Path.Should().Be(@"path\to\my.proj");
@@ -54,8 +58,9 @@ public void WithOneArguments_PackageIsSet()
5458
{
5559
// Arrange
5660
Command rootCommand = new("nuget");
61+
var console = new Lazy<IAnsiConsole>(() => new TestConsole());
5762

58-
WhyCommand.Register(rootCommand, new TestConsole(), whyCommandArgs =>
63+
WhyCommand.Register(rootCommand, console, whyCommandArgs =>
5964
{
6065
// Assert
6166
whyCommandArgs.Path.Should().NotBeNull();
@@ -75,8 +80,9 @@ public void WithZeroArguments_HasParseError()
7580
{
7681
// Arrange
7782
Command rootCommand = new("nuget");
83+
var console = new Lazy<IAnsiConsole>(() => new TestConsole());
7884

79-
WhyCommand.Register(rootCommand, new TestConsole(), whyCommandArgs =>
85+
WhyCommand.Register(rootCommand, console, whyCommandArgs =>
8086
{
8187
// Assert
8288
throw new Exception("Should not get here");
@@ -92,8 +98,9 @@ public void WithThreeArguments_HasParseError()
9298
{
9399
// Arrange
94100
Command rootCommand = new("nuget");
101+
var console = new Lazy<IAnsiConsole>(() => new TestConsole());
95102

96-
WhyCommand.Register(rootCommand, new TestConsole(), whyCommandArgs =>
103+
WhyCommand.Register(rootCommand, console, whyCommandArgs =>
97104
{
98105
// Assert
99106
throw new Exception("Should not get here");
@@ -112,8 +119,9 @@ public void FrameworkOption_CanBeAtAnyPosition(string args)
112119
{
113120
// Arrange
114121
Command rootCommand = new("nuget");
122+
var console = new Lazy<IAnsiConsole>(() => new TestConsole());
115123

116-
WhyCommand.Register(rootCommand, new TestConsole(), whyCommandArgs =>
124+
WhyCommand.Register(rootCommand, console, whyCommandArgs =>
117125
{
118126
// Assert
119127
whyCommandArgs.Path.Should().Be("my.proj");
@@ -135,8 +143,9 @@ public void FrameworkOption_CanBeLongOrShortForm(string arg)
135143
{
136144
// Arrange
137145
Command rootCommand = new("nuget");
146+
var console = new Lazy<IAnsiConsole>(() => new TestConsole());
138147

139-
WhyCommand.Register(rootCommand, new TestConsole(), whyCommandArgs =>
148+
WhyCommand.Register(rootCommand, console, whyCommandArgs =>
140149
{
141150
// Assert
142151
whyCommandArgs.Path.Should().Be("my.proj");
@@ -156,8 +165,9 @@ public void FrameworkOption_AcceptsMultipleValues()
156165
{
157166
// Arrange
158167
Command rootCommand = new("nuget");
168+
var console = new Lazy<IAnsiConsole>(() => new TestConsole());
159169

160-
WhyCommand.Register(rootCommand, new TestConsole(), whyCommandArgs =>
170+
WhyCommand.Register(rootCommand, console, whyCommandArgs =>
161171
{
162172
// Assert
163173
whyCommandArgs.Path.Should().Be("my.proj");
@@ -177,8 +187,9 @@ public void HelpOption_ShowsHelp()
177187
{
178188
// Arrange
179189
Command rootCommand = new("nuget");
190+
var console = new Lazy<IAnsiConsole>(() => new TestConsole());
180191

181-
WhyCommand.Register(rootCommand, new TestConsole(), whyCommandArgs =>
192+
WhyCommand.Register(rootCommand, console, whyCommandArgs =>
182193
{
183194
// Assert
184195
whyCommandArgs.Path.Should().Be("my.proj");

0 commit comments

Comments
 (0)