Skip to content

Commit 41f38b8

Browse files
authored
Merge branch 'release/10.0.2xx' into darc-release/10.0.2xx-97438f3c-bc28-4eaf-adba-4031b4acc786
2 parents 31f5075 + 7ca819d commit 41f38b8

File tree

151 files changed

+1533
-1043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+1533
-1043
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,11 @@ dotnet_diagnostic.IDE0040.severity = warning
511511
insert_final_newline = false
512512

513513
# Verify settings
514-
[*.{received,verified}.{txt,xml,json}]
514+
[*.{received,verified}.{txt,xml,json,sh,zsh,nu,fish,ps1}]
515515
charset = "utf-8-bom"
516516
end_of_line = lf
517517
indent_size = unset
518518
indent_style = unset
519519
insert_final_newline = false
520520
tab_width = unset
521-
trim_trailing_whitespace = false
521+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,7 @@
6767
*.verified.txt text eol=lf working-tree-encoding=UTF-8
6868
*.verified.xml text eol=lf working-tree-encoding=UTF-8
6969
*.verified.json text eol=lf working-tree-encoding=UTF-8
70+
*.verified.sh text eol=lf working-tree-encoding=UTF-8
71+
*.verified.zsh text eol=lf working-tree-encoding=UTF-8
72+
*.verified.nu text eol=lf working-tree-encoding=UTF-8
73+
*.verified.fish text eol=lf working-tree-encoding=UTF-8

.vscode/settings.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
22
"dotnet.testWindow.disableAutoDiscovery": true,
3-
"dotnet.defaultSolution": "sdk.slnx"
3+
"dotnet.testWindow.disableBuildOnRun": true,
4+
"dotnet.defaultSolution": "cli.slnf",
5+
"files.associations": {
6+
"*.slnf": "json",
7+
"*.props": "xml",
8+
"*.targets": "xml",
9+
"*.*proj": "xml"
10+
}
411
}

cli.slnf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"solution": {
3+
"path": "sdk.slnx",
4+
"projects": [
5+
"src\\BuiltInTools\\dotnet-watch\\dotnet-watch.csproj",
6+
"src\\Cli\\dotnet\\dotnet.csproj",
7+
"src\\Cli\\Microsoft.DotNet.Cli.Utils\\Microsoft.DotNet.Cli.Utils.csproj",
8+
"test\\dotnet-new.IntegrationTests\\dotnet-new.IntegrationTests.csproj",
9+
"test\\dotnet-watch.Tests\\dotnet-watch.Tests.csproj",
10+
"test\\dotnet.Tests\\dotnet.Tests.csproj",
11+
"test\\Microsoft.DotNet.Cli.Utils.Tests\\Microsoft.DotNet.Cli.Utils.Tests.csproj",
12+
"test\\Microsoft.NET.TestFramework\\Microsoft.NET.TestFramework.csproj"
13+
]
14+
}
15+
}

sdk.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
</Folder>
6363
<Folder Name="/src/Cli/">
6464
<Project Path="src/Cli/dotnet/dotnet.csproj" />
65+
<Project Path="src/Cli/Microsoft.DotNet.Cli.CommandLine/Microsoft.DotNet.Cli.CommandLine.csproj" />
6566
<Project Path="src/Cli/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj" />
6667
<Project Path="src/Cli/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj" />
6768
<Project Path="src/Cli/Microsoft.DotNet.FileBasedPrograms/Microsoft.DotNet.FileBasedPrograms.Package.csproj" />

src/BuiltInTools/BrowserRefresh/Microsoft.AspNetCore.Watch.BrowserRefresh.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,10 @@
2525
</ItemGroup>
2626

2727
<Import Project="..\Web.Middleware\Microsoft.DotNet.HotReload.Web.Middleware.projitems" Label="Shared" />
28+
29+
<ItemGroup>
30+
<EmbeddedResource Update="@(EmbeddedResource)">
31+
<LogicalName>%(FileName)%(Extension)</LogicalName>
32+
</EmbeddedResource>
33+
</ItemGroup>
2834
</Project>

src/BuiltInTools/Web.Middleware/BrowserScriptMiddleware.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public async Task InvokeAsync(HttpContext context)
4848
// for backwards compat only
4949
internal static ReadOnlyMemory<byte> GetBlazorHotReloadJS()
5050
{
51-
var jsFileName = "Microsoft.AspNetCore.Watch.BrowserRefresh.BlazorHotReload.js";
51+
var jsFileName = "BlazorHotReload.js";
5252
using var stream = new MemoryStream();
5353
var manifestStream = typeof(BrowserScriptMiddleware).Assembly.GetManifestResourceStream(jsFileName)!;
5454
manifestStream.CopyTo(stream);
@@ -66,7 +66,7 @@ internal static ReadOnlyMemory<byte> GetBrowserRefreshJS()
6666

6767
internal static ReadOnlyMemory<byte> GetWebSocketClientJavaScript(string hostString, string serverKey)
6868
{
69-
var jsFileName = "Microsoft.AspNetCore.Watch.BrowserRefresh.WebSocketScriptInjection.js";
69+
var jsFileName = "WebSocketScriptInjection.js";
7070
using var reader = new StreamReader(typeof(BrowserScriptMiddleware).Assembly.GetManifestResourceStream(jsFileName)!);
7171
var script = reader.ReadToEnd()
7272
.Replace("{{hostString}}", hostString)

src/BuiltInTools/Web.Middleware/Microsoft.DotNet.HotReload.Web.Middleware.Package.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,19 @@
3838
<ItemGroup>
3939
<Using Remove="@(Using)" />
4040
</ItemGroup>
41+
42+
<PropertyGroup>
43+
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);_AddJSFilesToSourcePackage</TargetsForTfmSpecificContentInPackage>
44+
</PropertyGroup>
45+
46+
<!--
47+
Add .js files as embedded resources in the source package.
48+
-->
49+
<Target Name="_AddJSFilesToSourcePackage">
50+
<ItemGroup>
51+
<!-- Must be in 'cs' directory since NuGet filters the files based on consuming project language -->
52+
<_File Include="$(MSBuildProjectDirectory)\**\*.js" TargetDir="contentFiles/cs/$(TargetFramework)" BuildAction="EmbeddedResource" />
53+
<TfmSpecificPackageFile Include="@(_File)" PackagePath="%(_File.TargetDir)/%(_File.RecursiveDir)%(_File.FileName)%(_File.Extension)"/>
54+
</ItemGroup>
55+
</Target>
4156
</Project>

src/BuiltInTools/dotnet-watch/CommandLine/CommandLineOptions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Diagnostics;
99
using Microsoft.Build.Logging;
1010
using Microsoft.DotNet.Cli;
11+
using Microsoft.DotNet.Cli.CommandLine;
1112
using Microsoft.DotNet.Cli.Commands.Run;
1213
using Microsoft.DotNet.Cli.Extensions;
1314
using Microsoft.Extensions.Logging;
@@ -119,7 +120,7 @@ internal sealed class CommandLineOptions
119120
// determine subcommand:
120121
var explicitCommand = TryGetSubcommand(parseResult);
121122
var command = explicitCommand ?? RunCommandParser.GetCommand();
122-
var buildOptions = command.Options.Where(o => o is IForwardedOption);
123+
var buildOptions = command.Options.Where(o => o.ForwardingFunction is not null);
123124

124125
foreach (var buildOption in buildOptions)
125126
{
@@ -161,7 +162,7 @@ internal sealed class CommandLineOptions
161162
var commandArguments = GetCommandArguments(parseResult, watchOptions, explicitCommand, out var binLogToken, out var binLogPath);
162163

163164
// We assume that forwarded options, if any, are intended for dotnet build.
164-
var buildArguments = buildOptions.Select(option => ((IForwardedOption)option).GetForwardingFunction()(parseResult)).SelectMany(args => args).ToList();
165+
var buildArguments = buildOptions.Select(option => option.ForwardingFunction!(parseResult)).SelectMany(args => args).ToList();
165166

166167
if (binLogToken != null)
167168
{
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.CommandLine;
2+
using System.CommandLine.Completions;
3+
4+
namespace Microsoft.DotNet.Cli.CommandLine;
5+
6+
/// <summary>
7+
/// Extension methods that make it easier to chain argument configuration methods when building arguments.
8+
/// </summary>
9+
public static class ArgumentBuilderExtensions
10+
{
11+
extension<T>(Argument<T> argument)
12+
{
13+
public Argument<T> AddCompletions(Func<CompletionContext, IEnumerable<CompletionItem>> completionSource)
14+
{
15+
argument.CompletionSources.Add(completionSource);
16+
return argument;
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)