Skip to content

Commit

Permalink
[main] Update dependencies from dotnet/roslyn, nuget/nuget.client (#379)
Browse files Browse the repository at this point in the history
[main] Update dependencies from dotnet/roslyn, nuget/nuget.client


 - Add dependency on Microsoft.Extensions.Logging 8.0.0

match the version that roslyn wants
dotnet/roslyn#71916

 - Revert "Add dependency on Microsoft.Extensions.Logging 8.0.0"

This reverts commit f947f38.

 - Add temporary reference to Microsoft.Extensions.Logging 8.0.0

 - Cleanup dependencies, remove MSBuildLocator

MSBuildLocator is no longer needed since dotnet/roslyn#70469 and the workarounds for NuGet.Framework can be removed too.
  • Loading branch information
dotnet-maestro[bot] committed Apr 9, 2024
1 parent 532e19a commit fbe3136
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 70 deletions.
8 changes: 2 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.CodeAnalysis" Version="4.9.2-3.24129.6">
<Dependency Name="Microsoft.CodeAnalysis" Version="4.10.0-3.24202.15">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>9934fb9e3527e1c0c51314e57d4aab30f97e8f9e</Sha>
<Sha>cbca41cad4e21c29548e9e57d7135740b6f78df9</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3">
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
Expand Down Expand Up @@ -31,9 +31,5 @@
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>9e3b333509ec2990dd20fbf01f50fd42d7f23d56</Sha>
</Dependency>
<Dependency Name="NuGet.Build.Tasks" Version="6.10.0-preview.2.81">
<Uri>https://github.com/nuget/nuget.client</Uri>
<Sha>1845d6bd450a7453d573035371c9fec43683d1ef</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
7 changes: 1 addition & 6 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@
<!-- Opt-out repo features -->
<UsingToolXliff>false</UsingToolXliff>
<!-- Libs -->
<MicrosoftBuildLocatorVersion>1.4.1</MicrosoftBuildLocatorVersion>
<MicrosoftCodeAnalysisAnalyzersVersion>3.3.4</MicrosoftCodeAnalysisAnalyzersVersion>
<MicrosoftCodeAnalysisVersion>4.9.2-3.24129.6</MicrosoftCodeAnalysisVersion>
<!-- Dependencies from https://github.com/nuget/nuget.client -->
<NuGetBuildTasksPackageVersion>6.10.0-preview.2.81</NuGetBuildTasksPackageVersion>
<NuGetFrameworksPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetFrameworksPackageVersion>
<MicrosoftCodeAnalysisVersion>4.10.0-3.24202.15</MicrosoftCodeAnalysisVersion>
<!-- arcade -->
<MicrosoftDotNetBuildTasksTemplatingVersion>9.0.0-beta.24207.1</MicrosoftDotNetBuildTasksTemplatingVersion>
<MicrosoftDotNetRemoteExecutorVersion>9.0.0-beta.24207.1</MicrosoftDotNetRemoteExecutorVersion>
Expand All @@ -29,6 +25,5 @@
<RefOnlyMicrosoftBuildFrameworkVersion>$(RefOnlyMicrosoftBuildVersion)</RefOnlyMicrosoftBuildFrameworkVersion>
<RefOnlyMicrosoftBuildTasksCoreVersion>$(RefOnlyMicrosoftBuildVersion)</RefOnlyMicrosoftBuildTasksCoreVersion>
<RefOnlyMicrosoftBuildUtilitiesCoreVersion>$(RefOnlyMicrosoftBuildVersion)</RefOnlyMicrosoftBuildUtilitiesCoreVersion>
<RefOnlyNugetProjectModelVersion>6.2.4</RefOnlyNugetProjectModelVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,16 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<!-- from dotnet/roslyn -->
<PackageReference Include="Microsoft.CodeAnalysis" Version="$(MicrosoftCodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(MicrosoftCodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="$(MicrosoftCodeAnalysisVersion)" />
<!-- this one has the EnC analyzer that we need-->
<PackageReference Include="Microsoft.CodeAnalysis.Features" Version="$(MicrosoftCodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="$(MicrosoftCodeAnalysisVersion)" />
<!-- to support MSBuildWorkspace -->
<PackageReference Include="Microsoft.Build.Locator" Version="$(MicrosoftBuildLocatorVersion)" />
<PackageReference Include="Microsoft.Build" Version="$(RefOnlyMicrosoftBuildVersion)" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.Build.Framework" Version="$(RefOnlyMicrosoftBuildFrameworkVersion)" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="$(MicrosoftCodeAnalysisVersion)" />
<!-- added to fix error when opening an MSBuildWorkspace project:
"ProcessFrameworkReferences" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'NuGet.Frameworks' ...
-->
<PackageReference Include="Nuget.ProjectModel" Version="$(RefOnlyNugetProjectModelVersion)">
<IncludeAssets>build; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>

<!-- TODO: workaround for https://github.com/dotnet/roslyn/issues/72938, remove once it is fixed -->
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 0 additions & 6 deletions src/Microsoft.DotNet.HotReload.Utils.Generator/Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ protected Runner (Config config) {
protected Func<CancellationToken,Task>? OutputsDone {get; set;} = null;

public async Task<BaselineArtifacts> SetupBaseline (EnC.EditAndContinueCapabilities capabilities, CancellationToken ct = default) {
InitMSBuild();
BaselineProject baselineProject = await Microsoft.DotNet.HotReload.Utils.Generator.BaselineProject.Make (config, capabilities, ct);

var baselineArtifacts = await baselineProject.PrepareBaseline(ct);
Expand Down Expand Up @@ -113,10 +112,5 @@ public async Task GenerateDeltas (DeltaProject deltaProject, IAsyncEnumerable<De
}
}

private static void InitMSBuild ()
{
Microsoft.Build.Locator.MSBuildLocator.RegisterDefaults();
}

}

21 changes: 0 additions & 21 deletions tests/HotReload.Generator/EnC.Tests/CommonFixtures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,6 @@

namespace EnC.Tests;

public class MSBuildLocatorFixture : IDisposable
{
private static readonly object _lock = new();
public MSBuildLocatorFixture()
{
if (Microsoft.Build.Locator.MSBuildLocator.IsRegistered)
return;
lock (_lock)
{
if (Microsoft.Build.Locator.MSBuildLocator.IsRegistered)
return;
var vsi = Microsoft.Build.Locator.MSBuildLocator.RegisterDefaults();
Console.WriteLine($"Using MSBuild at '{vsi.MSBuildPath}' to load projects and targets.\n{vsi}");
}
}

public void Dispose()
{
}
}

public class GlobalFilesFixture : IDisposable
{
public string GlobalJsonContents { get; }
Expand Down
14 changes: 0 additions & 14 deletions tests/HotReload.Generator/EnC.Tests/EnC.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="$(MicrosoftCodeAnalysisVersion)" />

<PackageReference Include="Microsoft.Build.Locator" Version="$(MicrosoftBuildLocatorVersion)" />
<PackageReference Include="Microsoft.Build" Version="$(RefOnlyMicrosoftBuildVersion)" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.Build.Framework" Version="$(RefOnlyMicrosoftBuildFrameworkVersion)" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="$(MicrosoftCodeAnalysisVersion)" />
<!-- added to fix error when opening an MSBuildWorkspace project:
"ProcessFrameworkReferences" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'NuGet.Frameworks' ...
-->
<PackageReference Include="Nuget.ProjectModel" Version="$(RefOnlyNugetProjectModelVersion)">
<IncludeAssets>build; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="NuGet.Frameworks" Version="$(NuGetFrameworksPackageVersion)" />

</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ namespace EnC.Tests;
/// Set <c>TempDir.Keep = true</c> if you want to keep the temp directory.
/// </para>
/// </remarks>
public class TempMSBuildWorkspaceTest : IClassFixture<MSBuildLocatorFixture>, IClassFixture<GlobalFilesFixture>, IDisposable
public class TempMSBuildWorkspaceTest : IClassFixture<GlobalFilesFixture>, IDisposable
{
public MSBuildWorkspace Workspace { get; }
public GlobalFilesFixture GlobalFiles { get; }
private protected TempDirectory TempDir { get; }
public TempMSBuildWorkspaceTest(MSBuildLocatorFixture _1, GlobalFilesFixture globalFiles)
public TempMSBuildWorkspaceTest(GlobalFilesFixture globalFiles)
{
GlobalFiles = globalFiles;
Workspace = MSBuildWorkspace.Create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace EnC.Tests;

public class WatchHotReloadServiceTest : TempMSBuildWorkspaceTest
{
public WatchHotReloadServiceTest(MSBuildLocatorFixture fixture, GlobalFilesFixture globalFiles) : base(fixture, globalFiles)
public WatchHotReloadServiceTest(GlobalFilesFixture globalFiles) : base(globalFiles)
{
}

Expand Down

0 comments on commit fbe3136

Please sign in to comment.