Skip to content

Commit 7f197e6

Browse files
authored
Merge branch 'main' into dependabot/nuget/SDV.App/Serilog.Extensions.Logging-9.0.2
2 parents 6b7a545 + ddf9552 commit 7f197e6

24 files changed

+143
-239
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ riderModule.iml
55
/_ReSharper.Caches/
66
.idea/
77
**/node_modules/
8-
SDV.sln.DotSettings.user
8+
SDV.sln.DotSettings.user
9+
.vs

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SDV - Solution Dependencies Visualiser
22

33
![MIT License](https://img.shields.io/github/license/AndriiLab/SDV)
4-
![.NET Core 9.0](https://img.shields.io/badge/.net%20core-9.0-blue)
4+
![.NET Core 10.0](https://img.shields.io/badge/.net%20core-10.0-blue)
55
![Last Commit](https://img.shields.io/github/last-commit/AndriiLab/SDV)
66
![Last release](https://img.shields.io/github/release-date/AndriiLab/SDV)
77

@@ -36,7 +36,7 @@ But you can also check functional output demo [here](https://andriilab.github.io
3636
## Prerequisites
3737

3838
- Windows platform (only supported for now by GUI)
39-
- [.NET 9](https://dotnet.microsoft.com/en-us/download/dotnet/9.0)
39+
- [.NET 10](https://dotnet.microsoft.com/en-us/download/dotnet/10.0)
4040

4141
## Installation
4242

SDV.App/SDV.App.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>net9.0-windows</TargetFramework>
5+
<TargetFramework>net10.0-windows</TargetFramework>
66
<Nullable>enable</Nullable>
77
<UseWPF>true</UseWPF>
8-
<Version>1.0.5</Version>
8+
<Version>1.1.0</Version>
99
<LangVersion>default</LangVersion>
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.3" />
13+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
1414
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.2" />
1515
</ItemGroup>
1616

SDV.DependenciesAnalyzer/AssetsJson/AssetsExtractor.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,13 @@
88

99
namespace SDV.DependenciesAnalyzer.AssetsJson;
1010

11-
public class AssetsExtractorBuilder : IExtractorBuilder
11+
public class AssetsExtractorBuilder(ILogger log) : IExtractorBuilder
1212
{
13-
private readonly ILogger _log;
14-
15-
public AssetsExtractorBuilder(ILogger log)
16-
{
17-
_log = log;
18-
}
19-
2013
public bool IsCompatible(string projectName, string dependenciesSource)
2114
{
2215
if (dependenciesSource.EndsWith("project.assets.json"))
2316
{
24-
_log.LogInformation("Found {File} file for project: {Project}", dependenciesSource, projectName);
17+
log.LogInformation("Found {File} file for project: {Project}", dependenciesSource, projectName);
2518
return true;
2619
}
2720

@@ -30,7 +23,7 @@ public bool IsCompatible(string projectName, string dependenciesSource)
3023

3124
public IExtractor GetExtractor(string dependenciesSource, string csprojPath, string solutionPath)
3225
{
33-
return AssetsExtractor.NewExtractor(dependenciesSource, _log);
26+
return AssetsExtractor.NewExtractor(dependenciesSource, log);
3427
}
3528

3629
private class AssetsExtractor : IExtractor

SDV.DependenciesAnalyzer/AssetsJson/AssetsUtils.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,11 @@
77

88
namespace SDV.DependenciesAnalyzer.AssetsJson;
99

10-
public class AssetsUtils
10+
public class AssetsUtils(ILogger log)
1111
{
12-
private readonly ILogger _log;
13-
1412
private const string AbsentNupkgWarnMsg =
1513
"Skipping adding this dependency to the dependency tree. This might be because the package already exists in a different NuGet cache, possibly the SDK's NuGetFallbackFolder cache. Removing the package from this cache may resolve the issue.";
1614

17-
public AssetsUtils(ILogger log)
18-
{
19-
_log = log;
20-
}
21-
2215
public List<string> GetDirectDependencies(ProjectAssetsJsonModel assets)
2316
{
2417
var frameworks = assets.Project.Frameworks;
@@ -67,7 +60,7 @@ public CaseInsensitiveMap<IDependencyDetails> GetAllDependencies(ProjectAssetsJs
6760
{
6861
if (IsPackagePartOfTargetDependencies(assets, libraryPath))
6962
{
70-
_log.LogWarning(
63+
log.LogWarning(
7164
"The file {File} doesn't exist in the NuGet cache directory but it does exist as a target in the assets files. {WarnMessage}",
7265
nupkgFilePath, AbsentNupkgWarnMsg);
7366
continue;
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
namespace SDV.DependenciesAnalyzer.Common;
22

3-
public class CaseInsensitiveMap<T> : Dictionary<string, T>
4-
{
5-
public CaseInsensitiveMap() : base(StringComparer.OrdinalIgnoreCase)
6-
{
7-
}
8-
}
3+
public class CaseInsensitiveMap<T>() : Dictionary<string, T>(StringComparer.OrdinalIgnoreCase);

SDV.DependenciesAnalyzer/Dependencies/DependenciesUtils.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,10 @@
44

55
namespace SDV.DependenciesAnalyzer.Dependencies;
66

7-
public class DependenciesUtils
7+
public class DependenciesUtils(ILogger log)
88
{
9-
private readonly ILogger _log;
10-
private TreeGeneratorConfiguration _configuration;
9+
private TreeGeneratorConfiguration _configuration = new(string.Empty, [], []);
1110

12-
public DependenciesUtils(ILogger log)
13-
{
14-
_log = log;
15-
_configuration = new TreeGeneratorConfiguration(string.Empty, [], []);
16-
}
17-
1811
public DependencyTree[] CreateDependencyTree(IExtractor extractor, TreeGeneratorConfiguration configuration)
1912
{
2013
_configuration = configuration;
@@ -35,7 +28,7 @@ public DependencyTree[] CreateDependencyTree(IExtractor extractor, TreeGenerator
3528
}
3629
else
3730
{
38-
_log.LogWarning("Unexpected dependency found in root dependencies array: {RootId}", rootId);
31+
log.LogWarning("Unexpected dependency found in root dependencies array: {RootId}", rootId);
3932
}
4033
}
4134

@@ -60,7 +53,7 @@ private IEnumerable<DependencyTree> FindChildrenDependencies(string id,
6053
}
6154
else
6255
{
63-
_log.LogWarning("Unexpected dependency found in children array: {ChildId}", childId);
56+
log.LogWarning("Unexpected dependency found in children array: {ChildId}", childId);
6457
}
6558
}
6659
}
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
namespace SDV.DependenciesAnalyzer.Exceptions;
22

3-
public class NugetDepsTreeException : Exception
4-
{
5-
public NugetDepsTreeException(string message) : base(message)
6-
{
7-
}
8-
}
3+
public class NugetDepsTreeException(string message) : Exception(message);
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
namespace SDV.DependenciesAnalyzer.Models;
22

3-
public class Project
3+
public class Project(string name, DependencyTree[] dependencies)
44
{
5-
public Project(string name, DependencyTree[] dependencies)
6-
{
7-
Name = name;
8-
Dependencies = dependencies;
9-
}
5+
public string Name { get; } = name;
106

11-
public string Name { get; }
12-
13-
public DependencyTree[] Dependencies { get; }
7+
public DependencyTree[] Dependencies { get; } = dependencies;
148
}
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
namespace SDV.DependenciesAnalyzer.Models;
22

3-
public class Tree
3+
public class Tree(string solutionName)
44
{
5-
public Tree(string solutionName)
6-
{
7-
SolutionName = solutionName;
8-
Projects = new List<Project>();
9-
}
10-
11-
public string SolutionName { get; }
12-
public List<Project> Projects { get; }
5+
public string SolutionName { get; } = solutionName;
6+
public List<Project> Projects { get; } = [];
137
}

0 commit comments

Comments
 (0)