Skip to content

Commit

Permalink
Merge pull request #23 from amaechler/dotnet-5-support
Browse files Browse the repository at this point in the history
Support .NET 5
  • Loading branch information
bjorkstromm committed Oct 24, 2021
2 parents 99c0a46 + 0e9d491 commit 3af75ab
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 22 deletions.
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "3.1.402",
"version": "5.0.402",
"rollForward": "latestPatch",
"allowPrerelease": false
}
Expand Down
2 changes: 0 additions & 2 deletions src/Depends.Core/DependencyAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
using NuGet.Frameworks;
using NuGet.Packaging.Core;
using NuGet.ProjectModel;
using NuGet.Protocol;
using NuGet.Protocol.Core.Types;
using NuGet.Versioning;
using System.Threading.Tasks;
using NuGet.Resolver;
using NuGet.Packaging;
using Microsoft.Build.Construction;
using Depends.Core.Output;

namespace Depends.Core
{
Expand Down
16 changes: 6 additions & 10 deletions src/Depends.Core/Depends.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<IsPackable>false</IsPackable>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Buildalyzer" Version="3.0.1" />
<PackageReference Include="NuGet.ProjectModel" Version="5.7.0" />
<PackageReference Include="MinVer" Version="2.3.1">
<PackageReference Include="Buildalyzer" Version="3.2.3" />
<PackageReference Include="MinVer" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>

<!-- The below is only to not run into incompatibilites with the NuGet version loaded by MSBuild -->
<PackageReference Include="NuGet.Build.Tasks" Version="5.7.0" />
<PackageReference Include="NuGet.Resolver" Version="5.7.0" />
<PackageReference Include="NuGet.Common" Version="5.7.0" />
<PackageReference Include="NuGet.ProjectModel" Version="5.11.0" />
<PackageReference Include="NuGet.Resolver" Version="5.11.0" />
</ItemGroup>

</Project>
5 changes: 1 addition & 4 deletions src/Depends.Core/Extensions/AnalyzerResultExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using Buildalyzer;
using Microsoft.Build.Execution;
using NuGet.Frameworks;

namespace Depends.Core.Extensions
Expand All @@ -25,6 +22,6 @@ internal static class AnalyzerResultExtensions
result.GetProperty("RuntimeIdentifier");

public static IEnumerable<ProjectItem> GetItems(this IAnalyzerResult result, string name) =>
result.Items.TryGetValue(name, out var items) ? items : Enumerable.Empty<ProjectItem>();
result.Items.TryGetValue(name, out var items) ? (IEnumerable<ProjectItem>)items : Enumerable.Empty<ProjectItem>();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using Depends.Core.Graph;
using NuGet.ProjectModel;

Expand Down
1 change: 0 additions & 1 deletion src/Depends.Core/Extensions/LoggerExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using NuGet.Common;
using Microsoft.Extensions.Logging;
using MEL = Microsoft.Extensions.Logging;
using ILogger = NuGet.Common.ILogger;
using LogLevel = NuGet.Common.LogLevel;
Expand Down
1 change: 0 additions & 1 deletion src/Depends.Core/Output/DotFileWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using Depends.Core.Graph;

namespace Depends.Core.Output
Expand Down
2 changes: 1 addition & 1 deletion src/Depends/Depends.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<ToolCommandName>dotnet-depends</ToolCommandName>
<PackAsTool>True</PackAsTool>
<OutputType>Exe</OutputType>
Expand Down

0 comments on commit 3af75ab

Please sign in to comment.