Skip to content

Commit

Permalink
Merge commit '843734df45746db9cbb4d2f5db721ae53f4c959f'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirroring committed Jan 23, 2025
2 parents 9466c71 + 843734d commit 90e8b20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ public sealed class DotNetMSBuildSdkResolver : SdkResolver
{
public override string Name => "Microsoft.DotNet.MSBuildSdkResolver";

// Default resolver has priority 10000 and we want to go before it and leave room on either side of us.
// Default resolver has priority 10000 and we want to go before it and leave room on either side of us.
public override int Priority => 5000;

private readonly Func<string, string?> _getEnvironmentVariable;
private readonly Func<string>? _getCurrentProcessPath;
private readonly Func<string, string, string?> _getMsbuildRuntime;
private readonly NETCoreSdkResolver _netCoreSdkResolver;

private const string DotnetHost = "DOTNET_HOST_PATH";
private const string DotnetHostExperimentalKey = "DOTNET_EXPERIMENTAL_HOST_PATH";
private const string MSBuildTaskHostRuntimeVersion = "SdkResolverMSBuildTaskHostRuntimeVersion";

private static CachingWorkloadResolver _staticWorkloadResolver = new();
Expand Down Expand Up @@ -201,11 +201,11 @@ private sealed class CachedState
if (File.Exists(dotnetExe))
{
propertiesToAdd ??= new Dictionary<string, string?>();
propertiesToAdd.Add(DotnetHost, dotnetExe);
propertiesToAdd.Add(DotnetHostExperimentalKey, dotnetExe);
}
else
{
logger?.LogMessage($"Could not set '{DotnetHost}' because dotnet executable '{dotnetExe}' does not exist.");
logger?.LogMessage($"Could not set '{DotnetHostExperimentalKey}' because dotnet executable '{dotnetExe}' does not exist.");
}

string? runtimeVersion = dotnetRoot != null ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
{
public class GivenAnMSBuildSdkResolver : SdkTest
{
private const string DotnetHost = "DOTNET_HOST_PATH";
private const string DotnetHostExperimentalKey = "DOTNET_EXPERIMENTAL_HOST_PATH";
private const string MSBuildTaskHostRuntimeVersion = "SdkResolverMSBuildTaskHostRuntimeVersion";

public GivenAnMSBuildSdkResolver(ITestOutputHelper logger) : base(logger)
Expand Down Expand Up @@ -206,7 +206,7 @@ public void ItReturnsHighestSdkAvailableThatIsCompatibleWithMSBuild(bool disallo
{
// DotnetHost is the path to dotnet.exe. Can be only on Windows.
result.PropertiesToAdd.Count.Should().Be(2);
result.PropertiesToAdd.Should().ContainKey(DotnetHost);
result.PropertiesToAdd.Should().ContainKey(DotnetHostExperimentalKey);
}
else
{
Expand Down Expand Up @@ -291,7 +291,7 @@ public void ItReturnsHighestSdkAvailableThatIsCompatibleWithMSBuildWhenVersionIn
{
// DotnetHost is the path to dotnet.exe. Can be only on Windows.
result.PropertiesToAdd.Count.Should().Be(4);
result.PropertiesToAdd.Should().ContainKey(DotnetHost);
result.PropertiesToAdd.Should().ContainKey(DotnetHostExperimentalKey);
}
else
{
Expand Down

0 comments on commit 90e8b20

Please sign in to comment.