Skip to content

Commit b50a486

Browse files
Merge release/10.0.2xx into darc-release/10.0.2xx-ea680444-399f-442b-a420-72d05ba02ac2
2 parents ee432c9 + 1af6f70 commit b50a486

File tree

113 files changed

+764
-221
lines changed

Some content is hidden

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

113 files changed

+764
-221
lines changed

Directory.Packages.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@
8282
<PackageVersion Include="Microsoft.TestPlatform.Build" Version="$(MicrosoftTestPlatformBuildPackageVersion)" />
8383
<PackageVersion Include="Microsoft.TestPlatform.CLI" Version="$(MicrosoftTestPlatformCLIPackageVersion)" />
8484
<PackageVersion Include="Microsoft.VisualStudio.Composition" Version="17.4.16" />
85-
<PackageVersion Include="Microsoft.VisualStudio.Sdk" Version="17.2.32505.173" />
86-
<PackageVersion Include="Microsoft.VSSDK.BuildTools" Version="17.11.435" />
8785
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="$(MicrosoftVisualStudioSetupConfigurationInteropVersion)" />
8886
<PackageVersion Include="Microsoft.VisualStudio.SolutionPersistence" Version="$(MicrosoftVisualStudioSolutionPersistenceVersion)" />
8987
<PackageVersion Include="Microsoft.Web.Deployment" Version="$(WebDeploymentPackageVersion)" />

NuGet.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
<add key="dotnet-tools-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools-transport/nuget/v3/index.json" />
3030
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
3131
<add key="dotnet-libraries-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries-transport/nuget/v3/index.json" />
32-
<add key="vssdk" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json" />
33-
<add key="vssdk-archived" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk-archived/nuget/v3/index.json" />
3432
<add key="vs-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json" />
3533
<!-- Used for Rich Navigation indexing task -->
3634
<add key="richnav" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />

eng/Signing.props

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,8 @@
8181
<FileSignInfo Include="Verify.dll" CertificateName="$(ExternalCertificateId)" />
8282
<FileSignInfo Include="Verify.DiffPlex.dll" CertificateName="$(ExternalCertificateId)" />
8383
</ItemGroup>
84-
85-
<ItemGroup>
86-
<FileSignInfo Include="StreamJsonRpc.dll" CertificateName="MicrosoftSHA2" />
8784

85+
<ItemGroup>
8886
<!-- Roslyn apphosts -->
8987
<FileSignInfo Condition="'$(TargetOS)' == 'osx'" Include="csc;vbc;VBCSCompiler" CertificateName="MacDeveloperHarden" />
9088
</ItemGroup>

eng/Version.Details.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ This file should be imported by eng/Versions.props
142142
<!-- dotnet/core-setup dependencies -->
143143
<NETStandardLibraryRefPackageVersion>2.1.0</NETStandardLibraryRefPackageVersion>
144144
<!-- microsoft/testfx dependencies -->
145-
<MicrosoftTestingPlatformPackageVersion>2.1.0-preview.25561.13</MicrosoftTestingPlatformPackageVersion>
146-
<MSTestPackageVersion>4.1.0-preview.25561.13</MSTestPackageVersion>
145+
<MicrosoftTestingPlatformPackageVersion>2.1.0-preview.25561.14</MicrosoftTestingPlatformPackageVersion>
146+
<MSTestPackageVersion>4.1.0-preview.25561.14</MSTestPackageVersion>
147147
</PropertyGroup>
148148
<!--Property group for alternate package version names-->
149149
<PropertyGroup>

eng/Version.Details.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,13 +557,13 @@
557557
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet</Uri>
558558
<Sha>89c8f6a112d37d2ea8b77821e56d170a1bccdc5a</Sha>
559559
</Dependency>
560-
<Dependency Name="Microsoft.Testing.Platform" Version="2.1.0-preview.25561.13">
560+
<Dependency Name="Microsoft.Testing.Platform" Version="2.1.0-preview.25561.14">
561561
<Uri>https://github.com/microsoft/testfx</Uri>
562-
<Sha>c60f4f766766774d2b45ff4f62abe3d9b269ebee</Sha>
562+
<Sha>1508e05c4c263d9054122fa7f32d76ecde483857</Sha>
563563
</Dependency>
564-
<Dependency Name="MSTest" Version="4.1.0-preview.25561.13">
564+
<Dependency Name="MSTest" Version="4.1.0-preview.25561.14">
565565
<Uri>https://github.com/microsoft/testfx</Uri>
566-
<Sha>c60f4f766766774d2b45ff4f62abe3d9b269ebee</Sha>
566+
<Sha>1508e05c4c263d9054122fa7f32d76ecde483857</Sha>
567567
</Dependency>
568568
<Dependency Name="Microsoft.Extensions.Configuration.Ini" Version="10.0.0-rc.2.25502.107">
569569
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet</Uri>

eng/Versions.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
compiler API targeted by analyzer assemblies. This is mostly an issue on source-build as
2929
in that build mode analyzer assemblies always target the live compiler API. -->
3030
<UsingToolMicrosoftNetCompilers Condition="'$(DotNetBuildSourceOnly)' == 'true'">true</UsingToolMicrosoftNetCompilers>
31-
<UsingToolVSSDK>true</UsingToolVSSDK>
3231
<FlagNetStandard1XDependencies Condition="'$(DotNetBuildSourceOnly)' == 'true'">true</FlagNetStandard1XDependencies>
3332
</PropertyGroup>
3433
<PropertyGroup Label="Servicing version information">

sdk.slnx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
<Project Path="src/BuiltInTools/HotReloadClient/Microsoft.DotNet.HotReload.Client.shproj" />
6060
<Project Path="src/BuiltInTools/Web.Middleware/Microsoft.DotNet.HotReload.Web.Middleware.Package.csproj" />
6161
<Project Path="src/BuiltInTools/Web.Middleware/Microsoft.DotNet.HotReload.Web.Middleware.shproj" />
62+
<Project Path="src/BuiltInTools/Watch.Aspire/Microsoft.DotNet.HotReload.Watch.Aspire.csproj" />
63+
<Project Path="src/BuiltInTools/Watch/Microsoft.DotNet.HotReload.Watch.csproj" />
6264
</Folder>
6365
<Folder Name="/src/Cli/">
6466
<Project Path="src/Cli/dotnet/dotnet.csproj" />
@@ -325,6 +327,8 @@
325327
<Project Path="test/Microsoft.AspNetCore.Watch.BrowserRefresh.Tests/Microsoft.AspNetCore.Watch.BrowserRefresh.Tests.csproj" />
326328
<Project Path="test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj" />
327329
<Project Path="test/Microsoft.DotNet.HotReload.Client.Tests/Microsoft.DotNet.HotReload.Client.Tests.csproj" />
330+
<Project Path="test/Microsoft.DotNet.HotReload.Test.Utilities/Microsoft.DotNet.HotReload.Test.Utilities.csproj" />
331+
<Project Path="test/Microsoft.DotNet.HotReload.Watch.Aspire.Tests/Microsoft.DotNet.HotReload.Watch.Aspire.Tests.csproj" />
328332
<Project Path="test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj" />
329333
<Project Path="test/Microsoft.DotNet.PackageInstall.Tests/Microsoft.DotNet.PackageInstall.Tests.csproj" />
330334
<Project Path="test/Microsoft.DotNet.TemplateLocator.Tests/Microsoft.DotNet.TemplateLocator.Tests.csproj" />
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using Microsoft.Extensions.Logging;
5+
6+
namespace Microsoft.DotNet.Watch;
7+
8+
internal static class DotNetWatchLauncher
9+
{
10+
public static async Task<bool> RunAsync(string workingDirectory, DotNetWatchOptions options)
11+
{
12+
var globalOptions = new GlobalOptions()
13+
{
14+
Quiet = options.IsQuiet,
15+
Verbose = options.IsVerbose,
16+
NoHotReload = false,
17+
NonInteractive = true,
18+
};
19+
20+
var commandArguments = new List<string>();
21+
if (options.NoLaunchProfile)
22+
{
23+
commandArguments.Add("--no-launch-profile");
24+
}
25+
26+
commandArguments.AddRange(options.ApplicationArguments);
27+
28+
var rootProjectOptions = new ProjectOptions()
29+
{
30+
IsRootProject = true,
31+
ProjectPath = options.ProjectPath,
32+
WorkingDirectory = workingDirectory,
33+
TargetFramework = null,
34+
BuildArguments = [],
35+
NoLaunchProfile = options.NoLaunchProfile,
36+
LaunchProfileName = null,
37+
Command = "run",
38+
CommandArguments = [.. commandArguments],
39+
LaunchEnvironmentVariables = [],
40+
};
41+
42+
var muxerPath = Path.GetFullPath(Path.Combine(options.SdkDirectory, "..", "..", "dotnet" + PathUtilities.ExecutableExtension));
43+
44+
var console = new PhysicalConsole(TestFlags.None);
45+
var reporter = new ConsoleReporter(console, globalOptions.Verbose, globalOptions.Quiet, suppressEmojis: false);
46+
var environmentOptions = EnvironmentOptions.FromEnvironment(muxerPath);
47+
var processRunner = new ProcessRunner(environmentOptions.GetProcessCleanupTimeout(isHotReloadEnabled: true));
48+
var loggerFactory = new LoggerFactory(reporter);
49+
var logger = loggerFactory.CreateLogger(DotNetWatchContext.DefaultLogComponentName);
50+
51+
using var context = new DotNetWatchContext()
52+
{
53+
ProcessOutputReporter = reporter,
54+
LoggerFactory = loggerFactory,
55+
Logger = logger,
56+
BuildLogger = loggerFactory.CreateLogger(DotNetWatchContext.BuildLogComponentName),
57+
ProcessRunner = processRunner,
58+
Options = globalOptions,
59+
EnvironmentOptions = environmentOptions,
60+
RootProjectOptions = rootProjectOptions,
61+
BrowserRefreshServerFactory = new BrowserRefreshServerFactory(),
62+
BrowserLauncher = new BrowserLauncher(logger, reporter, environmentOptions),
63+
};
64+
65+
using var shutdownHandler = new ShutdownHandler(console, logger);
66+
67+
try
68+
{
69+
var watcher = new HotReloadDotNetWatcher(context, console, runtimeProcessLauncherFactory: null);
70+
await watcher.WatchAsync(shutdownHandler.CancellationToken);
71+
}
72+
catch (OperationCanceledException) when (shutdownHandler.CancellationToken.IsCancellationRequested)
73+
{
74+
// Ctrl+C forced an exit
75+
}
76+
catch (Exception e)
77+
{
78+
logger.LogError("An unexpected error occurred: {Exception}", e.ToString());
79+
return false;
80+
}
81+
82+
return true;
83+
}
84+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System.Collections.Immutable;
5+
using System.CommandLine;
6+
using System.Diagnostics.CodeAnalysis;
7+
8+
namespace Microsoft.DotNet.Watch;
9+
10+
internal sealed class DotNetWatchOptions
11+
{
12+
/// <summary>
13+
/// The .NET SDK directory to load msbuild from (e.g. C:\Program Files\dotnet\sdk\10.0.100).
14+
/// Also used to locate `dotnet` executable.
15+
/// </summary>
16+
public required string SdkDirectory { get; init; }
17+
18+
public required string ProjectPath { get; init; }
19+
public required ImmutableArray<string> ApplicationArguments { get; init; }
20+
public bool IsVerbose { get; init; }
21+
public bool IsQuiet { get; init; }
22+
public bool NoLaunchProfile { get; init; }
23+
24+
public static bool TryParse(string[] args, [NotNullWhen(true)] out DotNetWatchOptions? options)
25+
{
26+
var sdkOption = new Option<string>("--sdk") { Arity = ArgumentArity.ExactlyOne, Required = true, AllowMultipleArgumentsPerToken = false };
27+
var projectOption = new Option<string>("--project") { Arity = ArgumentArity.ExactlyOne, Required = true, AllowMultipleArgumentsPerToken = false };
28+
var quietOption = new Option<bool>("--quiet") { Arity = ArgumentArity.Zero };
29+
var verboseOption = new Option<bool>("--verbose") { Arity = ArgumentArity.Zero };
30+
var noLaunchProfileOption = new Option<bool>("--no-launch-profile") { Arity = ArgumentArity.Zero };
31+
var applicationArguments = new Argument<string[]>("arguments") { Arity = ArgumentArity.ZeroOrMore };
32+
33+
verboseOption.Validators.Add(v =>
34+
{
35+
if (v.GetValue(quietOption) && v.GetValue(verboseOption))
36+
{
37+
v.AddError("Cannot specify both '--quiet' and '--verbose' options.");
38+
}
39+
});
40+
41+
var rootCommand = new RootCommand()
42+
{
43+
Directives = { new EnvironmentVariablesDirective() },
44+
Options =
45+
{
46+
sdkOption,
47+
projectOption,
48+
quietOption,
49+
verboseOption,
50+
noLaunchProfileOption
51+
},
52+
Arguments =
53+
{
54+
applicationArguments
55+
}
56+
};
57+
58+
var parseResult = rootCommand.Parse(args);
59+
if (parseResult.Errors.Count > 0)
60+
{
61+
foreach (var error in parseResult.Errors)
62+
{
63+
Console.Error.WriteLine(error);
64+
}
65+
66+
options = null;
67+
return false;
68+
}
69+
70+
options = new DotNetWatchOptions()
71+
{
72+
SdkDirectory = parseResult.GetRequiredValue(sdkOption),
73+
ProjectPath = parseResult.GetRequiredValue(projectOption),
74+
IsQuiet = parseResult.GetValue(quietOption),
75+
IsVerbose = parseResult.GetValue(verboseOption),
76+
ApplicationArguments = [.. parseResult.GetValue(applicationArguments) ?? []],
77+
NoLaunchProfile = parseResult.GetValue(noLaunchProfileOption),
78+
};
79+
80+
return true;
81+
}
82+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
4+
<PropertyGroup>
5+
<TargetFramework>$(SdkTargetFramework)</TargetFramework>
6+
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>
7+
<OutputType>Exe</OutputType>
8+
<RootNamespace>Microsoft.DotNet.Watch</RootNamespace>
9+
<IsShipping>true</IsShipping>
10+
11+
<!-- NuGet -->
12+
<IsPackable>true</IsPackable>
13+
<IsShippingPackage>true</IsShippingPackage>
14+
<PackAsTool>true</PackAsTool>
15+
<PackageId>Microsoft.DotNet.HotReload.Watch.Aspire</PackageId>
16+
<PackageDescription>
17+
A supporting package for Aspire CLI:
18+
https://github.com/dotnet/aspire
19+
</PackageDescription>
20+
</PropertyGroup>
21+
22+
<ItemGroup>
23+
<PackageReference Include="System.CommandLine" />
24+
<PackageReference Include="Microsoft.Build.Locator" />
25+
</ItemGroup>
26+
27+
<ItemGroup>
28+
<ProjectReference Include="..\Watch\Microsoft.DotNet.HotReload.Watch.csproj" />
29+
</ItemGroup>
30+
31+
<ItemGroup>
32+
<PublicAPI Include="PublicAPI.Shipped.txt" />
33+
<PublicAPI Include="PublicAPI.Unshipped.txt" />
34+
<PublicAPI Include="InternalAPI.Shipped.txt" />
35+
<PublicAPI Include="InternalAPI.Unshipped.txt" />
36+
</ItemGroup>
37+
38+
<Import Project="..\Watch\RuntimeDependencies.props" />
39+
</Project>
40+

0 commit comments

Comments
 (0)